J. H.
Tarapore School
Computer Applications (Std X)
Third Term Assignment (Holiday Homework) (2025-2026)
Java Programs
Q 17. Design a class to overload a function check() as follows:
(i) void check(String str, char ch) - to find and print the frequency of a character in a string.
Example: Input: str=“success” ch=‘s’
Output: number of s present is =3
(ii) void check(String s1) - to display only vowels from string s1, after converting it to lower case.
Example: Input: s1=“computer”
Output: o u e
Create a main function and call the above functions.
Q18. Special words are those words which start and end with the same letter.
Examples: EXISTENCE, COMIC, WINDOW
Palindrome words are those words which read the same from left to right and vice-versa.
Examples: MALAYALAM , MADAM, LEVEL, ROTATOR, CIVIC
All palindromes are special words, but all special words are not palindromes.
Write a program to accept a word check and print whether the word is a palindrome or only special
word.
Q19. Define a class to generate a pattern of a word in the form of a triangle or in the form of an inverted
triangle, depending upon user's choice.
Enter your choice: 1
Sample Output:
HAPPY
HAPP
HAP
HA
H
Enter your choice: 2
Sample Output:
S
MM
AAA
RRRR
TTTTT
Q20. 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 RDEEEMER, TAJMAHAL, GREAT WALL OF
CHINA, MACHU PICCHU, PETRA, COLOSSEUM
Locations – MEXICO, BRAZIL, INDIA, CHINA, PERU, JORDAN, ITALY
Example – Country Name: INDIA
Output: INDIA – TAJMAHAL
Country Name: USA
Output: Sorry Not Found!
Submission Date:
24th November, 2025