kisa computer qp
kisa computer qp
ICSE STD. X
Preparatory Examination 2024
Subject: Computer Applications
Maximum Marks: 100
Time Allowed: 2 hours Date: 24.01.2024
i. When a class serves as base class for many derived classes, the situation
is called
a. Polymorphism b. Encapsulation
e Inheritance d. Abstraction
v. How many bytes are allocated for the array al] if int a [l = new int (41:
a. 40 bytes b. 16 bytes c. 20 bytes d. 32 bytes
vi. The wrapper class of char type is
a. character b. Chracter Character d. Char
Page 1of 6
KARNATAKA ICSE ASSOCIATION
ICSE STD. X Preparatory Examination 2024SCHOOLS
Subject: Computer Applications Date: 24.01.2024
Maximum Marks: 100
Time Allowed: 2 hours
if(m%6==0)
KARNATAKA ICSE SCHOOLS ASSOCIATION
ICSE STD. X
Preparatory Examination 2024
Subject: Computer Applications
Maximum Marks: 100 Time Allowed: 2 hours Date: 24.01,2024
else
if(m%3=-0)
System.out.println(m);
a. Output is 15 b. 16 35
c. Output is 15
45
d, 45 15
xix. Read the following text and choose the correct answer
Page 3 of 6
KARNATAKA ICSE SCHOOLS ASSOCIATION
ICSE STD. X Preparatory Examination 2024
Subject: Computer Applications
Maximum Marks: 100 Time Allowed: 2 hours Date: 24.01.2024
hJ, 2) ,
Question 2 CHath powla+
Malh c
i. Write the java expression for/(a+ b)? (2]
ii. The following code segment should add the fifth and eight elements of the
array and displays the answer as 56. However, the code has errors. Fix the
code so that it compiles and runs correctly. (2]
int sl]-(2,22,3,32,4,42:5,52};
ifs|3]%2==0)
int sum=s[5]+s[7] ;
System.out.println(sum);
iv. John executes the following line of the program
will be a floating-point value, but he expects to get
and the answer displayed
the answer as 0. Name
the error and how can the given statement be
modified.
System.out.println(Math.sqrt(2)/10); math s t f. lo
[2]
v. How many times will the loop be
int a=12010;int d; executed? What will be the output? [2]
2
while(a>0)
d=a%100;
ift+d/3==0)
break;
a
(26
else
a=a/ 1000;
System.out.println(d);
vi. What will be the
a. output of the following string methods?
System.out.println("All the
Best".length)/2); s
b. System.out.printin("Acquatic".equalslgnoreCase("ACQUATIC"); [2]
)
pow(at bJ, 2
(Math
Question 2 Melh end [21
for/(a + b)2
i. Write the java expression
value of p=5
[2]
ii. Evaluate the expression when the
p*=++p t --p/++p tp;
the
code segment should add the fifth and eight elements of
iii. The following 56. However, the code has
errors. Fix the
as
array and displays the answer [2]
code so that it compiles and runs correctly.
int sl]=(2,22,3,32,4,42;5,52};
if(s|3]%2=-0)
int sum=s[5]+s[7];
System.out.println(sum);
program and the answer displayed
iv. John executes the following line of the
to get the ansSwer as 0. Name
will be a floating-point value, but he expects modified.
statement be
the error and how can the given [2]
System.out.println(Math. sqrt(2) /10);
math. sqt . |o
will be the output? [2]
v. How many times will the loop be executed? What 2
int a= 12010:int d:
while(a>0)
d=a%100;
if(++d/3==0)
break;
else 2090
a=a/1000;
System.out.printin(d);
vi. What will be the output of the following string methods? [2]
a. System.out.printin("All the Best".length()/2); s
b. System.out.println("Acquatic".equalslgnore Case("ACQUATIC");
vii. Differentiate between actual and formal parameters. S -9 o
[2]
q1
SECTION B
(Answer any four questions from this Section,)
Theanswvers in this section should consisl of theprograns in either Blue/ environment or any
progran envioment with javaas the base.
Each program should be vritten using variable description /mnemonic codes so that the logic
of the program is clearly depicted.
Flowcharts and algorithms are not required
Question 3 [15]
Design a class named Bill, which will contain the following members:
Data Members:
units,amt of int data type.
Member Functions: 2 o ).S
In the main() create an object and initialise u with any value and calculate
amt by invoking the compute()function and display the contents of Uan
amt using show() function.
KARNATAKA ICSE SCHOOLS ASSOCIATION
ICSE STD. X Preparatory Examination 2024
Subject: Computer Applications
Maximum Marks: 100 Time Allowed: 2 hours Date: 24.01.2024
Question 4 [15]
Write a program to input height of 10 Students in feet ( like 5.8, 6.1, ...] in
a single dimensional array. Sort the heights in ascending order, using
bubble sort technique and display the sorted array.
Question 5 [15]
into uppercase. Replace all
Write a program toaccept a string and convert it
display the new string.
the vowels in the string with the character #' and
[15]
Question 6
the following tasks:
Write a program to overload the function display() for
function void patern (char ch,int
1) To display the following pattern using the character to be printed.
n) wheren is the number of lines and ch is the
7***k
[15]
Question 7 number or
and check if it's a Peterson
Write a program to accept a number
not.
A number is said to be Peterson if
the sum of factorials of each digit is
number itself.
equal to the sum of the
For example:
Input:Enter a number=145
Output=1!+4!+5!=145
Question 8
(15]
array and find the sum of all the
Define a class to accept values into a 3x3
odd numbers in the array.
Example:
{5,3, 2), {4, 2, 5};
Input: Al-{4,5, 6},numbers=5+5+3+5=18
Output: Sum of odd