Class: X ICSE Assignment On Strings: Carmel High School

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Carmel High School

Basaveshwaranagar, Bangalore 560 079

Class : X ICSE Assignment on Strings

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 :

Character Frequency Character Frequency


A 2 O 2
C 2 P 3
I 1 R 1
L 2 S 1
M 1 T 2
N 1 U 1

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

6. Write a program to accept a String and display :


The number of digits
The number of uppercase characters
The number of lowercase characters
The number of special characters
The number of white space.

You might also like