KISA QP-Computer Applications - X
KISA QP-Computer Applications - X
Question 1 [10]
Choose the correct answers to the questions from the given options.
(Do not copy the question, write the correct answers only.)
i. When a class serves as base class for many derived classes, the situation
is called
a. Polymorphism b. Encapsulation
c. Inheritance d. Abstraction
iv. When the object of a wrapper class is assigned to primitive type variable,
the object is automatically converted to the primitive type is called as
v. How many bytes are allocated for the array a[] if int a [] = new int [4];
a. 40 bytes b. 16 bytes c. 20 bytes d. 32 bytes
Page 1 of 6
KARNATAKA ICSE SCHOOLS ASSOCIATION
ICSE STD. X Preparatory Examination 2024
Subject: Computer Applications
xii. ___________ compiles the Java source code into byte code
a. Virtual machine b. java interpreter
c. JVM compiler d. object code
xiii. The java statement to access the 5th character in the string str is:
a. str.indexOf(i) b. str.charAt(4)
c.str.substring(5) d. str.length()
xiv. A method prototype which has function name display() which takes two
characters as input and an integer number as a return type is
a. void display(int a ,int b) b. int display(int a ,int b)
c. int display(char a ,char b) d. char display(int a ,int b)
xv. The method compareTo() returns __________ when two strings are equal
and in lowercase :
a. true b. 0 c. 1 d. false
else
if(m%3==0)
System.out.println(m);
}
a. Output is 15 b. 16 35 c. Output is 15 d. 45 15
45
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
Question 2
3
i. Write the java expression for √(𝑎 + 𝑏)2 [2]
iii. 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 s[]={2,22,3,32,4,42,5,52};
if(s[3]%2==0)
int sum=s[5]+s[7];
System.out.println(sum);
iv. John executes the following line of the program and the answer displayed
will be a floating-point value, but he expects to get the answer as 0. Name
the error and how can the given statement be modified.
System.out.println(Math.sqrt(2)/10); [2]
v. How many times will the loop be executed? What will be the output? [2]
int a=12010;int d;
while(a>0)
{
d=a%100;
if(++d/3==0)
break;
else
a=a/1000;
System.out.println(d);
}
vi. What will be the output of the following string methods? [2]
a. System.out.println("All the Best".length()/2);
b. System.out.println("Acquatic".equalsIgnoreCase("ACQUATIC"));
Page 4 of 6
KARNATAKA ICSE SCHOOLS ASSOCIATION
ICSE STD. X Preparatory Examination 2024
Subject: Computer Applications
SECTION B
(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]
Design a class named Bill, which will contain the following members:
Data Members:
units,amt of int data type.
Member Functions:
Parameterised constructor to initialise units.
void show( ) to display the contents of units and amt.
void compute(int u ) :calculate the electricity bill with the help of the below
mentioned charges:
• 1 to 100 units – Rs.10/unit
• 100 to 200 units – Rs.15/unit
• 200 to 300 units – Rs.20/unit
• above 300 units – Rs.25/unit
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 U an
amt using show( ) function.
Page 5 of 6
KARNATAKA ICSE SCHOOLS ASSOCIATION
ICSE STD. X Preparatory Examination 2024
Subject: Computer Applications
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]
Write a program to accept a string and convert it into uppercase. Replace all
the vowels in the string with the character ‘#’ and display the new string.
Question 6 [15]
Write a program to overload the function display() for the following tasks:
i) To display the following pattern using the function void pattern (char ch,int
n) where n is the number of lines and ch is the character to be printed.
*****
****
***
**
*
ii) To display the sum of the following series
S=𝑎2 + 𝑎4 + 𝑎6 + ⋯ … . . +𝑛 𝑡𝑒𝑟𝑚𝑠
Question 7 [15]
Write a program to accept a number and check if it’s a Peterson number or
not.
A number is said to be Peterson if the sum of factorials of each digit is
equal to the sum of the number itself.
For example:
Input: Enter a number=145
Output=1!+4!+5!=145
Question 8 [15]
Define a class to accept values into a 3×3 array and find the sum of all the
odd numbers in the array.
Example:
Input: A[][]={{ 4 ,5, 6}, { 5 ,3, 2}, { 4, 2, 5}};
Output: Sum of odd numbers=5+5+3+5=18
Page 6 of 6