Page 1 :
Thursday, January 20, 2022, 8:16 PM, , 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”., , Write a statement for each of the following:, 1. Store a number 275 as a String, 2. Convert the String to a numeric value, 3. Add it to the existing total of 1000 to update the field, , Write a program to enter a sentence from the keyboard and count the number of times a, , COMBINED ICSE 246 Page 1
Page 2 :
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., , 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., , 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, , COMBINED ICSE 246 Page 2
Page 3 :
Write a program to input a sentence and print the number of characters found in the longest, word of the given sentence., For example is S = “India is my country” then the output should be 7., , Write a program to input a string in uppercase and print the frequency of each character., Example:, INPUT : COMPUTER HARDWARE, OUTPUT :, CHARACTERS, A, 2, C, 1, D, 1, E, 2, H, 1, M, 1, O, 1, P, 1, R, 3, T, 1, U, 1, W, 1, , FREQUENCY, , class board2010, {, char i,c;int j,ctr=0;, void main(String s), {, s=s.toUpperCase();, System.out.println("CHARACTER\tFREUENCY");, , COMBINED ICSE 246 Page 3
Page 4 :
for(i='A';i<='Z';i++), {, ctr=0;, for(j=0;j<s.length();j++), {, c=s.charAt(j);, if(c==i), ctr++;, }, if(ctr>0), System.out.println(i+"\t"+ctr);, }, }, }, , Write a program that encodes a word in Piglatin. To translate word into Piglatin word, 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, , Design a class to overload a function, Joystring() as follows :, , (i)void Joystring(String s, char ch1, char, ch2): with one string and two character, arguments that replaces the character, argument ch1 with the character, argument ch2 in the given string s and, points the new, string, Example :, Input value of s =, TECHNALAGY", ch1 = 'A' , ch2 =, 'O', Output : "TECHNOLOGY", (ii)void Joystring(String s) with one string, argument that prints the position of the, first space and the last space of the given, String, s., Example :First Index : 5, Last Index : 36, (iii)void Joystring(String s1, String s2), with two string arguments that combines, the two strings with a space between, them and prints the resultant, string, Exampl, e : Input value of s1 = "COMMON, WEALTH" ,, s2 = "GAMES", Output :, , COMBINED ICSE 246 Page 4
Page 5 :
"COMMON WEALTH GAMES", , To display the following pattern, I, IC, ICS, ICSE, , Write a program in Java to accept a string in lowercase and change the first letter of every, word to uppercase. Display the new string., Sample INPUT: we are in cyber world, Sample OUTPUT: We Are In Cyber World, , class board2018, {, int l,i;String w="",w1;char ch,c1;, void main(String s), {, s=s.toLowerCase();, s=s+" ";, l=s.length();, for(i=0;i<l;i++), {, ch=s.charAt(i);, if(ch!=' '), w=w+ch;, else, {, c1=Character.toUpperCase(w.charAt(0));, w1=c1+w.substring(1);, System.out.print(w1+" ");, w1="";, w="";, }, }, }, }, , COMBINED ICSE 246 Page 5
Page 6 :
a) Differentiate between autoboxing and unboxing., The process of converting a primitive data type value to its corresponding wrapper, class object is called boxing. For example, conversion from int to Integer., The process of converting an object of wrapper class to its corresponding primitive, data type value is called unboxing. For example, conversion from Integer to int., , Write a program to input a string and convert it into uppercase and print the pair, of vowels and number of pair of vowels occurring in the string., Example:, INPUT:, “BEAUTIFUL BEAUTIES”, OUTPUT:, Pair of vowels: EA, AU, EA, AU, IE, No. of pair of vowels: 5, , COMBINED ICSE 246 Page 6