Class: X ICSE Assignment On Strings: Carmel High School
Class: X ICSE Assignment On Strings: Carmel High School
Class: X ICSE Assignment On Strings: Carmel High School
1. Write a program in Java to enter a String/Sentence and display longest word, count the
vowels present in the longest word and the length of the longest word.
2. Write a program to input a String in uppercase. Create a new sentence by replacing each
vowel with the next vowel (i.e. A with E, E with I, I with O, O with U, U with A) and
the other characters remain the same. Display the new sentence accordingly.
Sample Input : CELEBRATE
Sample Output : CILIBRETI
3. Write a program to input a String. Count and display the frequency of each letter in the
order in which it is present in the String.
Sample Input : COMPUTER APPLICATIONS
Sample Output :
4. Write a program in Java to accept a name containing three words and display the surname
first, followed by the first and middle names.
Sample Input : MOHANDAS KARAMCHAND GANDHI
Sample Output : GANDHI MOHANDAS KARAMCHAND
5. 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