SES ICSE Sem-2 Specimen Paper 2022

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

SOUTH END SCHOOL

SEMESTER -2 SPECIMEN PAPER: 2021-22


COMPUTER APPLICATIONS
Maximum Marks: 50
Time allowed: One and a half hours
Answers to this Paper must be written on the paper provided separately.
You will not be allowed to write during the first 10 minutes.
This time is to be spent in reading the question paper.
The time mentioned at the head of this Paper is the time allowed for writing the answers.
_______________________________________________________________________________________

Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
_______________________________________________________________________________________
SECTION A
(Attempt all questions.)

Question 1
Choose the correct answers to the questions from the given options. (Do not copy the question, Write the
correct answer only.) [10]
(i) Identify the non-primitive data type from the following:

(a) Math

(b) int

(c) Scanner

(d) Both (a) and (c)

(ii) Which one is the most restrictive access specifier ?

(a) public

(b) private

(c) protected

(d) Default access specifier


1
(iii) The return data type of parseByte( ) method is ________ .

(a) Integer

(b) byte

(c) String

(d) Byte

(iv) Name the method of Character class that checks whether a character given as argument is a white space
or not.
(a) isWhiteSpace( )

(b) isSpace( )

(c) hasWhiteSpace( )

(d) hasSpace( )

(v) Predict the output of the following statement:

int X[ ] = {8, 5, 0, 1, 3};


System.out.println(X.length + Math.pow(X[1], X[2]));

(a) 5

(b) 6

(c) 5.0

(d) 6.0

(vi) Predict the output of the following statement.


System.out.println("PROGRAMS".compareTo("PROGRAM"));

(a) 0

(b) 83

(c) 1

(d) -83

(vii) protected int value = 25; This instance variable can be accessed from ______________ .

(a) Any class defined in any package

(b) Only the subclasses defined in any package

(c) Only the same class

(d) Other classes in the same package and subclasses of same package as well as different package
2
(viii) What is the data type of the argument given in startsWith( ) method of String class ?

(a) char

(b) boolean

(c) String

(d) No argument is provided

(ix) State the output of the following code fragment:

int c[ ] = {20, 74, 32, 10, 9, 87, 52, 37};

int p = c[c.length - 1];

int q = c[p%c[2]];

System.out.print(p+ "," +q);

(a) 74, 32

(b) 37, 87

(c) 10, 9

(d) 52, 37

(x) What will be the output generated by the following statement ?

System.out.print("Discovery".substring("Roboto".indexOf('o'), 5) ;

(a) A runtime error will be encountered

(b) A null string

(c) very

(d) isco

SECTION B
(Attempt any four questions.)
Flow-Charts and Algorithms are not required.
Variable Description is mandatory.

Question 2 [10]
Define a class to input a word in lower case. Find and display the following:
• The letter with the highest ASCII value
• The letter with the lowest ASCII value
3
Question 3 [10]
Define a class to declare an array to store 10 decimal values of double type and display all the values after
removing their fractional part.
Example:
Sample Input: 1.5, 5.7, 4.78, 8.9, 5.7, 23.7, 3.05, 7.37, 12.3, 6.8
Sample Output: 1, 5, 4, 8, 5, 23, 3, 7, 12, 6

Question 4 [10]
Define a class to declare an array that can accept 20 integers from the user. Now calculate the average of
the numbers and display the numbers greater than the average as well as smaller than the average separately
with proper messages.

Question 5 [10]
Define a class to accept a line of string containing multiple words. Now eliminate the last word and display
the modified string.
Example:
Sample Input: I have a lot of books pens
Sample Output: I have a lot of books

Question 6 [10]
Define a class to accept a string containing 20 digits without any space character from the user and declare
an integer array to store 10 double-digit numbers extracted sequentially from the left-hand side of the input
string. Now ask the user to enter an element to search in the array using the technique of Linear search and
if the element is found, display the number and its position in the array, otherwise display the message
“ELEMENT NOT FOUND” (assume that, position = index + 1).

Question 7 [10]
Define a class to accept 30 words in upper case in a String array and print only those words that starts with
‘C’ and ends with ‘E’.

You might also like