10A Worksheet
10A Worksheet
10A Worksheet
Choose the correct answers to the questions from the given options. (Do not copy the
question, Write the correct answer only.) [10]
(i) Name the method that can convert a string into its integer equivalent.
(a) Integer.parseInteger()
(b) Integer.getInt()
(c) Integer.parseInt()
(d) Integer.readInt()
(ii) Which one of the given statements is true for the following statement?
string1.compareTo(string2)
(a) if string1 > string2 the result will be a negative integer i.e. < 0.
(b) if string1 > string2 the result will be a positive integer i.e. > 0.
String s = “Malayalam”;
System,out.println(s.indexOf(‘y’));
(a) 3
(b) 4
(c) 5
(d) 6
(a) Int
(b) INTEGER
(c) Integer
(d) int
(v) Variables that are used to store the individual states of an object are called _________.
KISA 1 of 4
(a) Instance variable
(a) 4
(b) 5
(c) 6
(d) 7
(vii) A member variable declared with the public access specifier has visibility in _________.
(a) class
(b) subclass
(c) package
KISA 2 of 4
(viii) What is the data type that the following library function return?
isWhitespace(char ch)
(a) double
(b) int
(c) boolean
(d) char
(ix) Name the variable that is accessed via the class name.
(a) Char.toUpperCase()
(b) Char.isUpperCase()
(c) Character.toUpperCase()
(d) Character.isUpperCase()
Question 2 [10]
Write a program to search for an integer value input by the user in the list given below using linear search
technique. If found display "Search Successful" and print the index of the element in the array, otherwise
display "Search Unsuccessful".
{75, 86, 90, 45, 31, 50, 36, 60, 12, 47}
Question 3 [10]
Write a program to input integer elements into an array of size 20 and perform the following operations:
Question 4 [10]
Write a program to accept a word and convert it into lowercase if it is in uppercase, and display the new word
KISA 3 of 4
by replacing only the vowels with the character following it:
Example :
Sample Input : computer
Sample Output : cpmpvtfr
Question 5 [10]
Write a program to input and store roll numbers, names and marks in 3 subjects of n number
students in five single dimensional array and display the remark based on average marks as given
below: (The maximum marks in the subject are 100)
Question 6 [10]
Write a program that encodes a word into Piglatin. To translate word into a 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
Question 7 [10]
Write a program to perform binary search on a list of integers given below, to search for an
element input by the user, if it is found display the element along with its position, otherwise
display the message “Search element not found”.
{5, 7, 9, 11, 15, 20, 30, 45, 89, 97}
KISA 4 of 4