The document outlines a project format for a Class X Java programming assignment. It includes sections like front page, acknowledgements, introduction to Java, 50 Java programs with sample code and comments, and conclusion. It provides formatting guidelines and examples of programs involving variables, conditions, loops, arrays, methods and classes.
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0 ratings0% found this document useful (0 votes)
300 views9 pages
Java Programs For Class X Project
The document outlines a project format for a Class X Java programming assignment. It includes sections like front page, acknowledgements, introduction to Java, 50 Java programs with sample code and comments, and conclusion. It provides formatting guidelines and examples of programs involving variables, conditions, loops, arrays, methods and classes.
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 9
CLASS X PROJECT FORMAT
1)Front page 2)Acknowledgement 3)Certificate 4)Content or Index 5)Introduction to java 6)Java Programs (Total 50 programs) 7)Conclusion Note:
a) Write each program headings with comment.
b)Each program with variable descriptions
JAVA PROGRAMS (INTERNAL ASSESMENT FOR CLASS X)
1) WAP to convert days in to years, months and days. 2) WAP to find the difference between Compound and Simple Interest. 3) Write a class with name employee and basic as its data member, to find the gross pay of an employee for the following allowances and deduction. Use meaningful variables. Dearness Allowance=25%of the basic pay House Rent Allowance=15%of the basic pay Provident Fund= 8.33% of the basic pay Net pay=Basic pay +Dearness Allowance+ House Rent Allowance Gross pa=net pay-Provident fund 4) WAP to enter three different numbers and find the second largest using Min and Max function. 5) WAP to enter a year and check it is leap year or not. 6) An air-conditioned bus charges fare from the passengers based on the distance travelled as per the tariff given below. Distance Travelled Fare Up to 10 km Fixed charge Rs. 80 11 to 20 km Rs.6/km 21 to 30 km Rs.5/km 31 km and above Rs.4/km 7) WAP to enter three angles of triangle and check it is Equilateral, Isosceles or scalene triangle . 8) Using switch statement, write a menu driven program: i) To check and display whether a number input by the user is a Automorphic or not. Sample Input : 25 Solution : The square of 25 is 625 and 25 is present as the last two digit. Sample output : 25 is a Automorphic number. ii) WAP to accept a number and check whether the number is Duck or not. (A number is said to be Duck if the digit zero is (0) present in it but the number must not begins with zero) 9) Using switch statement, write a menu driven program: i) s=1-a+a2-a3+……+an ii) s=1/1!-2/2!+3/3!-4/4!+………+n/n! 10) WAP to input a number and check whether it is prime number or not. If it is not prime then display the next number that is prime. 11) WAP to input 10 different number. Display the greater and smallest number among them. 12) WAP to enter a number and check it is disarium number or not. Ex: 135=11+22+33=1+9+125=135 13) WAP to print all the Armstrong number between 100 to 500. (Sum of each cube is equal to the original number is called Armstrong no) 14) WAP to accept two numbers and find the GCD(Greatest Common Divisor) and LCM(Lowest common Divisor). 15) WAP to input a number and display it into its Binary equivalent. Ex: Input : (21)10 Output : (10101)2 16) WAP to enter a number and check it is Happy number or not. (Take a positive number and replace the number by the sum of the square of its digits. Repeat the process until the number will be single digit. If the number ends with 1 then it is called Happy number. 17) WAP to input a number. Display the product of the successor of even digits of the number entered by user. Input : 2745 Output : 15 Even digits are 2 and 4 then successor of even digits is 3*5=15 18) WAP to print the pattern 1 1 0 1 0 1 1 0 1 0 10 1 0 1 19) WAP to print the pattern 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1 20) WAP to print the pattern I I C I C S I C S E 21) WAP to enter a number and print in ascending order. Ex: Input : 5173 Output : 1357 22) WAP to enter a number and check it is twin prime or not. (Twin prime numbers are the prime numbers whose difference is 2) 23) WAP to enter a number and check it is palprime or not. (A number should be palindrome as well as prime. 24) Design a class P1 with the following functions to perform the given operations. a) int compute(int x)-It computes the sum of square of each digit of number x. b) void read() – Input a number and display its sum of square of each digit by invoking compute(). 25) Write a class with the name Area using method overloading that computes the area of a parallelogram, a rhombus and a trapezium. Area of parallelogram=base*ht; Area of rhombus=1/2*d1*d2; where d1 and d2 are the diagonals. Area of trapezium=1/2*(a+b)*h; where a and b are the parallel sides and h is the perpendicular distance between the parallel sides. 26) Write a program using a method Palin(), to check whether a String is a Palindrome or not. (A Palindrome is a String that reads the same from the left to right and vice versa, Sample Input : MADAM,ARORA etc. 27) Design a class to overload the method display(…) as follows: a) void display(int num) : checks and prints whether the number is a perfect square or not. b) void display(String str,char ch) : checks and prints the word str contains the letter ch or not. c) void display(String str) : checks and print the number of special characters present in the word str. Write a suitable main() method. 28) WAP to accept 10 different numbers in a single Dimensional Array(SDA).Display the greatest and smallest numbers of the array elements. 29) WAP to accept a set of 10 integers in a Single Dimensional Array. Sort the numbers in ascending order by using the “Bubble Sort” technique.Display the sorted array. 30) WAP to accept 10 different numbers in a SDA.Now enter a number and by using binary search technique, check whether or not the number is present in the list of array elements. If the number is present then display the message “Search Successful” else “Search not Successful”. 31) WAP to accept 10 different numbers in a SDA.Arrange the numbers in ascending order by using “Selection Sort”” technique and display them. 32) WAP to accept 10 different numbers in a SDA.Arrange the numbers in descending order by using “Bubble Sort”” technique and display them. 33) WAP to enter the elements in 3*3 matrics and display the sum of each row and column separately. 34) WAP to enter the values in 4*4 square matrics and print the sum of left and right diagonal separately. 35) WAP to enter the elements in a 3*3 matrics and print its Transpose of matrics. 36) WAP to enter a sentence and count the number of vowels and consonant present. 37) WAP to enter a sentence lower case and convert first letter of each word into capital. Display the new String. Sample Input : sky is blue Sample output : Sky Is Blue 38) WAP to enter a sentence and count how many number of letters, digits and special character present int it. 39) WAP to accept a name and display the initials along with the surname. Input : Mohandas Karamchand Gandhi Output : M.K. Gandhi. 40) WAP o accept a string .Convert the string to uppercase. Count and output the number of double letter sequences that exist in the string. Ex: SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE Sample output : 4 41) WAP to input forty words in an array. Arrange these words in descending order of letters by using Selection sort technique. Print the sorted array. Sample Input : New Delhi,Bengaluru,Agra,Mumbai,Kolkata Sample Output : New Delhi,Mumbai,Kolkata,Bengaluru,Agra 42) WAP to input a string in uppercase and print the frequency of each character present in the sentence. 43) WAP to accept a set of any 10 characters. Calculate and print the sum of ASCII codes of the characters. 44) WAP to input two integer numbers. Join them together to form a single number. Sample Input : First no : 134 and Second no : 96 Sample output : 13496 45) To display the following pattern A a b A B C A b c d A B C D E 46) WAP by using a class with the following specifications: Class name : Prime Data member : int n Member Methods: Prime() : Default constructor to initialize n void input(int x) : to assign n with x void display() : To check whether the number is prime or not The main() method need not be written to perform the above tasks. 47) Define a class student described as below: Data member : name,age,m1,m2,m3(Marks in 3 subjects),maximum, average Member methods: i) A parametrized constructor to initialize the data members ii) To accept the details of a student iii) To compute the average and the maximum out of three marks iv) To display the name,age,marks in three subjects, maximum and average. 48) WAP by using a class with the following specification : Class name : Piglatin Data member : String wd Member Methods : Piglatin() : constructor to initialize the String wd void input(String wd) : to accept a word void display() : To convert the word in Piglatin form and display it. Sample Input : trouble Sample output : oubletray 49) Define a class Bill that calculates the telephone bill of a consumer with the following description: Data member: Int bno : bill number String name : name of consumer Int call : no. of calls consumed in a month Double amt : bill amount to be paid by the person Member Methods: Bill() : constructor to initialize data members with default initial value Bill(….) : parameterized constructor to accept billno,name and no of calls consumed. Calculate() : to calculate the monthly telephone bill for a consumer as per the following condition Unit consumed Rate First 100 calls Rs.0.60/call Next 100 calls Rs.0.80/call Next 100 calls Rs.1.20/call Above 300 calls Rs.1.50/call
Fixed monthly rental applicable to all consumers Rs. 125
Display() : to display the details Create an object in the main() method and invoke the above functions to perform the desired task. 50) “A number is said to be Palindrome, if it appears to be the same after reversing its digits”.WAP by using a class with the following specifications: Class name : Number Data member : private int num Member Methods: Number(int x) : constructor to initialize num with x Int revers(int n) : used to return the reverse of number Void palindrome() : to check and print whether the number is Palindrome or not.