0% found this document useful (0 votes)
77 views1 page

Class: X ICSE Assignment On Strings: Carmel High School

The document contains 6 programming assignments related to strings in Java. The assignments include: 1) Finding the longest word in a string, counting vowels, and word length. 2) Changing vowels in a uppercase string. 3) Counting letter frequencies. 4) Displaying a name with surname first. 5) Checking if a string is unique. 6) Counting digits, uppercase, lowercase, special characters, and whitespace in a string.

Uploaded by

Kushal raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views1 page

Class: X ICSE Assignment On Strings: Carmel High School

The document contains 6 programming assignments related to strings in Java. The assignments include: 1) Finding the longest word in a string, counting vowels, and word length. 2) Changing vowels in a uppercase string. 3) Counting letter frequencies. 4) Displaying a name with surname first. 5) Checking if a string is unique. 6) Counting digits, uppercase, lowercase, special characters, and whitespace in a string.

Uploaded by

Kushal raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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