Page 443 - CA_Blue( J )_Class10
P. 443
JAV JA
JA JAV
J JAVA
c. JAVA d. AVAJ
AVA AVA
VA AV
A A
22. Write a program print the patterns
a. ABCDE b. ABCDE
ABCD BCDE
ABC CDE
AB DE
A E
c. A d. A
AB BC
ABC DEF
ABCD GHIJ
ABCDE
23. Write a program to accept five names and marks of students in two single-dimensional order and print the following in
alphabetical order using selection sort technique.
24. Write a menu-driven program to input a word and print according to the following.
Input: PROGRAM
If choice is 1: PROGRAM If choice is 2 :
PROGRAM M
ROGRAM AM
OGRAM RAM
GRAM GRAM
RAM OGRAM
AM ROGRAM
M PROGRAM
25. Write a program to accept a sentence then convert each character to second next character. The character A becomes
C, Y becomes A and Z becomes B.
26. Write a program in java to enter a string and create a word by joining all the first characters of each word and display the new word.
Input: Vital Information Resource Under Seize
Output: VIRUS
27. Write a program to input a sentence and print the character which occur maximum no of times within a string.
Input: INDIA IS MY COUNTRY
Output: The character that occurs maximum numbers of times : I
28. Input a word and after removing all the repeated letters, print the new word
Input: india
Output : inda
29. Write a program to input two words and print the common alphabets in them.
Input :
Enter 1st word : INDIA
Enter 2nd word : DELHI
Common ALPHABETS : I,D
30. Write a program to input a sentence. Input a word and print the frequency of the word in the sentence.
D. Assertion and Reasoning based questions.
The following questions consist of two statements – Assertion (A) and Reason (R). Answer these questions by selecting the
441
String Handling 441

