0 ratings0% found this document useful (0 votes) 157 views9 pagesCompter App - Specimen Paper
Specimen computer science for icse2023
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
ICSE 2023 EXAMINATION
SPECIMEN QUESTION PAPER
COMPUTER APPLICATIONS
Maximum Marks: 100
Time allowed: Two hours
Answers to this Paper must be written on the paper provided separately.
You will not be allowed to write during the first 15 minutes
This time is (o be spent in reading the question paper.
The time given at the head of this Paper is the time allowed for writing the answers,
This Paper is divided into two Sections.
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[ J.
SECTION A
(Attempt all questions from this Section.)
Question 1 [20]
Choose the correct answer and write the correct option.
@ Wrapping up of data and methods together as one unit is termed as:
(a) Inheritance
(b) Polymorphism
(©) Encapsulation
(@) Abstraction
«i The datatype which is specified that the method does not return a value is:
(a) Void
(b) void
(©) voID
(@ boolean
723 861 — SPECIMI 1of9Gi)
(iv)
wy)
(wi)
ey 13.0 28 12
The logical operator which is an unary operator:
@ &&
) |
© !
@ >
‘The Scanner class is a class.
(@) Primitive
(b) Derived
(©) Wrapper od) +b. &
(@) super class
Math.pow(625, Ys) + Math.sqrt(144)
(@) 170
= 67.0
© 370
wD
‘The correct if statement for the following ternary operation statement is:
System.out println(n%2 = 0? “true”:"false”);
(@) if(n%2==0)
retum true;
else
return false;
(b) if(u%2—=0)
return “true”;
else
return “false”;
(c) if(n'%2==0)
System.out println(“true”);
else
System.out printIn(“false”);
‘123 861 — SPECIMEN 20f9@)_ if(n%2—=0)
retum false;
else
return false;
(vii) Multiple branching statement of java is:
(a) For
(&) while
© do... while
(@) switch
(viii) The number of bytes occupied by the constant 45 are:
(a) Four bytes
(©) two bytes,
(©) Eight bytes
@ one byte
(ix) do.....While loop is an
(a) entry controlled loop
(b) infinite loop
(©) exit controlled loop
@_ Finite loop
@ for(k=1k<=:
{ for(m=1;m<=4;m+)
k++)
{ System.out.printin(m*2);
}
}
How many times the inner loop is executed?
(a) 4 times
(&) 8times
(©) 2times
(16 times
23 861 — SPECIMEN 30f9(xi) A method with the same name as of the class and with arguments and no return.
data type is termed as:
(a) parameterized constructor
(b) default constructor
(©) Non—parameterized constructor
(@) wrapper class method
(i) What is the value of res?
) 66
(© 65
@ 97
(xiii) The style of expressing single line comment is: ‘
@ comment) 2— yy) y tt tine, commN ent.
(>) * comment
er Femme W
(@_ /* comment
(xiv) The method to check if'a character is an alphabet or not is
\.GBLetier(chax) 7 * x
(b) isAlpha(char) x do wu wen.
(©) _isUppercase(char) at
(@ _ isLowercase(char) +e / Comme”
(xx) The output of Double,parseDouble(“71.25”) +0.75
(a) 72 ”
Aw 2.0 Stun +o Dou ble
(c) 71.0
@ 71.75
123 861 — SPECIMEN 40f9(xvi) ‘The method to convert a string to upper case is:
(@) toUpperCase(char)
(b) toUPPERCASE(String)
{9 ToUpperCase(String)
(@)_touppercase(String)
(xvii) The output of the method “DETERMINATION” substring(2, 6) is:
Ve TERM"
(b) term
(©. “Term”
(@_ “TERMI”
(xviii) The array int x[10] occupies:
(a) Loy) Lp % 10
4940 bytes *
(© 2 bytes
(80 bytes
(xix) The element in x[4] of the array {3, 5, 7, 12, 16, 18, 20, 35, 42, 89} is’
ris 01234
(b) 12
© 7
@ 18
(xx) Name the type of error that occurs for the following statement:
System.out printIn(Math.sqrt(24 - 25));
(@) Syntax error
(b) runtime error
\Ler logical error
(@)_ no error
‘23 861 — SPECIMEN 5of9Question 2 yor 1OT4Y4F|Lt%
@ Evaluate the expression: 3 7] 2
Ztsatt+—-b+ tat --b;
where a= Be b=$,Z=10
Gi) Write java AM
ii) Rewrite the following using temary operators: RI
if(x>y)
21
x? +xy
(iv) Rewrite the following while loop using for loop: (2
int x =55
while (x <= 5)
{
xHy
}
System.out println(x);
wv) How many times the following loop will gets executed? What is the output of [2]
the same?
int counter=1;
do
{
System.out printIn(counter);
} while ( counter ++ <5 );
(vi) “MISSISSIPPI” replace(‘S’, ‘t’).toLowerCase() Ql
(vii) “REDUCE” compareTo(“REVOLT”) + “ANTARTICA” lastindexOf(‘A’) 2]
(viii) Define boxing with an example. 2
(x) Consider the following program and answer the questions given below: 2)
class sample
{ — inta,b;
723 861 - SPECIMEN 60f9sample(int x, int y)
{ a=xb=y;
3
void caleulate()
{— intz;
z= ath;
System.out printin(z);
3
(a) Name the global variables.
(6) What are the method variables?
®) Consider the following array and answer the questions given below: 2)
int x [ ] = (23, 45, 67, 12, 45, 89, 24, 12, 9, 7}
(a) What is the size of the array?
(b) What is the position of 89? aw L vest of
eGo Bo he queshon-
(Answer any four questions from this Section.)
‘The answers in this section should consist of the programs in either BlueJ environment or any
program environment with java as the base.
Each program should be written using variable description / mnemonic codes so that the logic of the
program is clearly depicted.
Flowcharts and algorithms are not required.
Question 3 15]
Define a class with the following specifications:
Class name: employee
Member variables: eno ~ employee number
ename — name of the employee
age —age of the employee
basic — basic salary
[Declare the variables using appropriate data types]
23 861 — SPECIMEN 7009Member methods:
void accept() accept the details using scanner class
void calculate ()— _ to calculate the net salary as per the given specifications:
net = basic + hra + da—pf
hra = 18.5% of basic
da = 17.45% of basic
pf=8.10% of basic
if the age of the employee is above 50 he/she
gets an additional allowance of Rs.5000,
void print() — to print the details as per the following format
eno ename age, basic —net
void main() — to create an object of the class and invoke the methods
Question 4 U5]
Define a class to overload the method print as follows:
void print ()~to print the format 1
23
45 6
789 10
boolean print (int n) to check whether the number is a Dudeney number ,
a number is dudeney if the cube of the sum of the
digits is equal to the number itself.
Eg : 512 =(5+142)3 = (8)3 = 512
void print (int a, char ch) — if ch = s or S print the square of the number el
ch =c or C print the cube of the number.
Question 5 (15)
Define a class to accept 10 integers and arrange them in descending order using bubble
sort. Print the original array and the sorted array.
Question 6 1s]
Define a class to accept values into a double array of size 20 and print the range of the
array, range is the difference between the largest and the smallest elements of the array.
723 861 — SPECIMEN 80f9Question 7 115]
Define a class to accept a string and print the same in reverse, also print the number of
vowels in the string.
Eg: $= “BEAUTIFUL” Output ~ “LUFITUAEB”
No. of vowels = 5
Question 8 (15)
Define a class to accept the names of 10 students in an array and check for the existence
of the given name in the array using linear search, if found print the position of the name,
if not found print the appropriate message. Also print the names which begins with the
word “SRI”.
723 861 — SPECIMEN 90f9