1.
Write a program to input any given string to calculate the total number of characters
and vowels present in the string and also reverse the string:-
Example INPUT:
Enter string : SNOWY
OUTPUT:
Total number of characters : 05
Number of Vowels : 01
Reverse string : YWONS
2. Consider the following statement:-
"January 26 is celebrated as the Republic Day of India".
Write a program to change 26 to 15, January to August, Republic to Independence and
finally print "August 15 is celebrated as the Independence Day of India".
3. Write a program to enter a sentence from the keyboard and count the number of times
a particular word occurs in it. Display the frequency of the search word. Example:
INPUT: Enter a sentence : the quick brown fox jumps over the lazy dog.
Enter a word to be searched : the
OUTPUT: Searched word occurs : 2 times
4. Write a program using a method Palin(), to check whether a string is a Palindrome or
not. A Palindrome is a string that reads the same from left to right and vice versa.
E.g. MADAM, ARORA, ABBA, etc.
5. Write a program to input a string and print out the text with the uppercase and
lowercase letters reversed, but all other characters should remain the same as before.
Example:
INPUT : WelComE TO School
OUTPUT : wELcOMe to sCHOOL
6. Write a program to input a sentence and print the number of characters found in the longest word of
the given sentence. For example if S=“India is my country” then the output should be 7
7. Write a program to input a string in uppercase and print the frequency of each
character.
Example:
Input: COMPUTER HARDWARE
Output:
CHARACTERS FREQUENCY
A 2
C 1
D 1
E 2
H 1
M 1
O 1
P 1
R 3
T 1
U 1
W 1
8. Write a program to accept a word and convert it into lowercase if it is uppercase, and display the
new word by replacing only the vowels with the character following. Example: Sample
input: computer Output: cpmpvtfr
9. Write a program to accept a string. Convert the string to uppercase. Count and output
the number of double letter sequences that exist in the string.
Sample Input: “SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE”
Sample Output: 4
10. Write a program that encodes a word into piglatin. To translate a word into piglatin,
convert the word into uppercase and then place the first vowel of the original word as
the start of the new word along with the remaining alphabets. The alphabets present
before the vowel being shifted towards the end followed by “AY”.
Sample input (1) : London, Sample output(1) : ONDONLAY
Sample input (2) : Olympics, Sample output(2) : OLYMPICSAY
11. Write a program to assign a full path and file name as given below. Using library functions,
extract and output the file path, file name and file extension separately as shown.
Input C:\Users\admin\Pictures\[Link]
Output Path: C:\Users\admin\Pictures\
File name: flower
Extension: jpg
12. Special words are those words which starts and ends with the same letter. [15]
Examples:
EXISTENCE
COMIC
WINDOW
Palindrome words are those words which read the same from left to right and vice-versa.
Example:
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.
13. Write a java program to input two strings and swap them without using third String variable.