Grade X CA Lab Manual Program List 24-25
Grade X CA Lab Manual Program List 24-25
Enter 'c' to calculate the perimeter of the circle,’t’ to calculate perimeter of the triangle and
'r' to calculate perimeter of the rectangle.
void check (String str , char ch ) — to find and print the frequency of a character in a string.
Example:
Input:
str = "success"
ch = 's'
Output:
number of s present is = 3
void check(String s1) — to display only vowels from string s1, after converting it to lower
case.
Example:
Input:
s1 ="computer"
Output : o u e
void check(String s, char ch1, char ch2) with one string argument and two character
arguments that replaces the character argument ch1 with the character argument ch2 in the
given String s and prints the new string.
Example:
Input: value of s = "TECHNALAGY"
ch1 = 'A'
ch2 = 'O'
Output: "TECHNOLOGY"
Lab manual program no 18:
Define a class to accept a string and convert the same to uppercase, create and display the
new string by replacing each vowel by immediate next character and every consonant by the
previous character. The other characters remain the same.
Example: Input: #IMAGINATION@2024
Output: #JLBFJMBSJPM@2024