| SNo. | Program Statement | Solution Code and Description |
|---|---|---|
| 1. | Java Program to Check whether a given number is a Prime Number. | |
| 2. | Java Program to Check whether a given number is a Spy Number. (ICSE 2017) | |
| 3 | Java Program to Check whether a given string is a Palindrome. | |
| 4. | Java Program to find reverse of a given number. | |
| 5. | Write a program that allows a user to input 20 integer elements into an array. Once the array is populated, the program should perform the following operations. (ICSE 2017)
1. Display the largest number from the array. 2. Display the smallest number from the array. 3. Display the sum of all the elements of the array. |
|
| 6. | Write a program to search a number using Linear Search. (Important)
1. The program should accept an array of integers. 2. Accept a target value to be searched. 3. Displays Found if the number is found in the array. Print Not Found otherwise. |
|
| 7. | Design a class RailwayTicket with following description.
Instance variables/data members. String name : To store the name of the customer. String coach : To store the type of coach customer wants to travel. long mobno : To store customer’s mobile number. int amt : To store basic amount of ticket. int totalamt : To store the amount to be paid after updating the original amount. Member methods : void accept () – To take input for name, coach, mobile number and amount. void update() – To update the amount as per the coach selected. extra amount to be added in the amount as follows) Type of Coaches Amount First_AC = 700 Second_AC = 500 Third_AC = 250 sleeper = None void display() – To display all details of a customer such as name, coach, total amount and mobile number. Write a main method to create an object of the class and call the above member methods. |
|
| 8. | Write a program to input a number and check and print whether it is a Pronic number or not. (ICSE 2018)
Pronic number is the number which is the product of two consecutive integers. |
|
| 9. | Write a program in Java to accept a string in lower case and change the first letter of every word to upper case. Display the new string.
Sample input: we are in cyber world Sample output: We Are In Cyber World |
|
| 10. | Design a class to overload a function volume() as follows.
(i) double volume (double R) – with radius (R) as an argument, returns the volume of sphere using the formula. V = 4/3 x 22/7 x R 3 (ii) double volume (double H, double R) – with height(H) and radius(R) as the arguments, returns the volume of a cylinder using the formula. V = 22/7 x R 2 x H (iii) double volume (double L, double B, double H) – with length(L), breadth(B) and Height(H) as the arguments, returns the volume of a cuboid using the formula. V = L x B x H |
|
| 11. | Write a menu driven program to display the pattern as per user’s choice.
Pattern-1 Pattern-2 ABCDE B ABCD LL ABC UUU AB EEEE A For an incorrect option, an appropriate error message should be displayed. |
|
| 12. | Many more programs to be covered to make you exam ready. |
|
| 13. | Many more programs to be covered to make you exam ready. |
|
| 14. | Many more programs to be covered to make you exam ready. |
|
| 15. | Many more programs to be covered to make you exam ready. |