ICSE2022-23 PROJECT
ICSE2022-23 PROJECT
1. name
2. price
3. dis
4. amt
Member Methods:
Write a main method to create an object of the class and call the member
methods.
Q2. Write a program to accept a word and print whether the word is a palindrome or
only special word.
Q3. Write a program to initialize the seven Wonders of the World along with their
locations in two different arrays. Search for a name of the country input by the user.
If found, display the name of the country along with its Wonder, otherwise display
“Sorry Not Found!”.
Seven wonders - CHICHEN ITZA, CHRIST THE REDEEMER, TAJMAHAL,
GREATWALL OF CHINA, MACHU PICCHU, PETRA, COLOSSEUM
Locations -
MEXICO, BRAZIL, INDIA, CHINA, PERU, JORDAN, ITALY
Example –
Country Name : INDIA Output : INDIA -TAJMAHAL
1. Country Name : USA Output : Sorry Not Found!
(b)double series(double a, double n) with two double arguments and returns the
sum of the series.
sum = (1/a2) + (4/a5) + (7/a8) + (10/a11) + .......... to n terms
1. void polygon(int n, char ch) — with one integer and one character type
argument to draw a filled square of side n using the character stored in ch.
2. void polygon(int x, int y) — with two integer arguments that draws a filled
rectangle of length x and breadth y, using the symbol '@'.
3. void polygon() — with no argument that draws a filled triangle shown below:
Example:
Q7. Write a program by using a class to check if the input number is a Prime
Palindrome with the following specifications:
Instance variables:
1. int num
2. int f
3. int rev
Member Methods:
Q8. Write a program to assign a full path and file name as given below. Using
library functions, extract and output the file path, file name and file extension
separately as shown.
Input C:\Users\admin\Pictures\flower.jpg
Output Path: C:\Users\admin\Pictures\
File name: flower
Extension: jpg
Q9. Write a program in Java to accept a String in upper case and replace all the
vowels present in the String with Asterisk (*) sign.
Sample Input: "TATA STEEL IS IN JAMSHEDPUR"
Sample output: T*T* ST**L *S *N J*MSH*DP*R
Q10. Write a program to input integer elements into an array of size 20 and perform
the following
operations:
(i) Display largest number from the array.
(ii) Display smallest number from the array.
(iii) Display sum of all the elements of the array.
Q11. Write a program to generate a triangle or an inverted triangle based upon
User’s choice.
Example 1:
Input: Type 1 for a triangle and
Type 2 for an inverted triangle
Enter your choice 1
Enter a word : BLUEJ
Sample Output:
if choice is 1 Output will be
B
LL
UUU
EEEE
JJJJJ
BLUEJ
BLUE
BLU
BL
B
Q12. A string is said to be ‘Unique’ if none of the letters present in the string are
repeated. Write a program to accept a string and check whether the string is
Unique or not. The program displays a message accordingly.
Sample Input: COMPUTER
Sample Output: Unique String
Q13. Using the switch statement, write a menu driven program for the following:
Q14. Write a program to accept the year of graduation from school as an integer value from the user. Using the
Binary Search technique on the sorted array of integers given below, output the message “Record exists” if the value
input is located in the array. If not, output the message “Record does not exist”. {1982, 1987, 1993, 1996, 1999, 2003,
2006, 2007, 2009, 2010}
Q15. Write a program to input two characters from the keyboard. Find the
difference (d) between their ASCII codes. Display the following messages:
If d=0 : both the characters are same.
If d<0 : first character is smaller.
If d>0 : second character is smaller.
Sample Input :
D
P
Sample Output :
d= (68-80) = -12
First character is smaller
Q16. Write a program that encodes a word into Pig Latin. To translate a word into
a pig Latin word, convert the word into uppercase and then place the first vowel of
the original word as the start of the new word along with the remaining alphabets.
The alphabets present before the vowel being shifted towards the end followed by
“AY”.
Sample Input (1) : London, Sample Output (1) : ONDONLAY
Sample Input (2) : Olympics, Sample Output (2) : OLYMPICSAY
Q17. Write a program to input two unequal positive numbers and check whether
they are perfect square numbers or not. If the user enters a negative number then
the program displays the message 'Square root of a negative number can't be
determined'.
Sample Input: 81, 100
Sample Output: They are perfect square numbers.
Sample Input: 225, 99
Sample Output: 225 is a perfect square number.
99 is not a perfect square number.
Q18. Write a program to input marks in English, Maths and Science of 40 students
who have passed ICSE Examination 2014. Now, perform the following tasks:
(a) Number of students, who have secured 95% or more in all the subjects.
(b) Number of students, who have secured 90% or more in English, Maths and
Science.
Q19. Write a menu driven program to accept a number from the user and check
whether it is a Prime number or an Automorphic number.
(a) Prime number: (A number is said to be prime, if it is only divisible by 1 and
itself)
Example: 3,5,7,11
(b) Automorphic number: (Automorphic number is the number which is contained
in the last digit(s) of its square.)
Example: 25 is an Automorphic number as its square is 625 and 25 is present as
the last two digits.
Q20. Using a switch statement, write a menu driven program to:
(a) Generate and display the first 10 terms of the Fibonacci series
0, 1, 1, 2, 3, 5
The first two Fibonacci numbers are 0 and 1, and each subsequent number is the
sum of the previous two.
(b) Find the sum of the digits of an integer that is input.
Sample Input: 15390
Sample Output: Sum of the digits = 18
For an incorrect choice, an appropriate error message should be displayed.
---------------------x-----------------