KnowledgeBoat Logo
KnowledgeBoat Logo
Home
Class 10 - ICSE Computer Applications Solved Question Papers
Solved 2024 Question Paper ICSE Class 10 Computer Applications
2024
Specimen 2024
2023
2022
2019
2018
2017
2016
2015
2014
2013
2012
2011
Solved 2011 Question Paper ICSE Class 10 Computer Applications
2010
2024
Solved 2024 Question Paper ICSE Class 10 Computer Applications
Class 10 - ICSE Computer Applications Solved Question Papers
Section A
Question 1(i)
Consider the below picture and choose the correct statement from the following:
Consider the below picture and choose the correct statement. Polygon is the object
and the pictures are classes. Both polygon and the pictures are classes. ICSE 2024
Computer Applications Solved Question Paper.
Polygon is the object and the pictures are classes
Both polygon and the pictures are classes
Polygon is the class and the pictures are objects
Both polygon and the pictures are objects
Answer
In this case:
Polygon represents the class because it defines the general structure, properties,
and methods common to all polygons (e.g., sides, vertices, perimeter calculation).
The pictures are specific examples or instances of polygons, such as triangles,
parallelogram, or pentagons, making them objects created from the Polygon class.
Question 1(ii)
int x = 98; char ch = (char)x; what is the value in ch?
b
A
B
97
Answer
Reason — In Java, when an int value is cast to char, it is converted based on the
ASCII code. Since, 98 is the ASCII code of the letter b, hence value of ch is 'b'.
Question 1(iii)
The output of the statement "CONCENTRATION".indexOf('T') is:
9
7
6
(-1)
Answer
6
Reason — The method indexOf(char ch) in Java returns the index of the first
occurrence of the specified character ch in the string. If the character is not
found, it returns -1.
Let’s count the characters by their index (Java uses zero-based indexing):
C O N C E N T R A T I O N
0 1 2 3 4 5 6 7 8 9 10 11 12
The first occurrence of the character 'T' is at index 6.
Question 1(iv)
The access specifier that gives least accessibility is:
package
public
protected
private
Answer
private
Question 1(v)
The output of the statement "talent".compareTo("genius") is:
11
–11
0
13
Answer
13
How It Works:
We compare "talent" and "genius" using their first differing characters:
Question 1(vi)
Which of the following is an escape sequence character in Java?
/n
\t
/t
//n
Answer
\t
b
c
a
wrong expression
Answer
Reason — The && (Logical AND) operator in Java is used to combine two boolean
expressions. It returns true only if both expressions are true. If either of the
expressions is false, the entire condition becomes false.
In this sequence:
a is the largest number because it is greater than both b and c.
Question 1(viii)
What is the output of Math.ceil(5.4)+Math.ceil(4.5)?
10.0
11.0
12.0
9.0
Answer
11.0
Math.ceil(5.4):
5.4 is rounded up to 6.0.
Math.ceil(4.5):
4.5 is rounded up to 5.0.
Question 1(ix)
What is the method to check whether a character is a letter or digit?
isDigit(char)
isLetterOrDigit()
isLetterOrDigit(char)
isLETTERorDIGIT(char)
Answer
isLetterOrDigit(char)
isDigit(char) – This method only checks if the character is a digit, not a letter.
isLetterOrDigit() – Incorrect because this method requires a character parameter.
isLETTERorDIGIT(char) – Java methods are case-sensitive, and method names follow
camelCase. This method name does not exist.
Question 1(x)
The extension of a Java source code file is:
exe
obj
jvm
java
Answer
java
Reason — In Java, source code files are saved with the .java extension. These files
contain the Java program's source code, written in human-readable text format.
Question 1(xi)
The number of bytes occupied by a character array of four rows and three columns
are:
12
24
96
48
Answer
24
Reason — In Java, a character (char) takes 2 bytes because Java uses Unicode
encoding.
Given:
Character Array: 4 rows and 3 columns
Total Elements = 4 × 3 = 12 characters
Memory Calculation:
Each character = 2 bytes
Total Memory = 12 × 2 = 24 bytes
Question 1(xii)
Which of the following data type cannot be used with switch case construct?
int
char
String
double
Answer
double
Reason — The switch statement in Java supports specific data types for the case
labels. However, double and float data types cannot be used.
int
char
String
Question 1(xiii)
Which of the following are entry controlled loops?
(a) for
(b) while
(c) do..while
(d) switch
only a
a and b
a and c
c and d
Answer
a and b
Reason — An entry-controlled loop checks the loop condition before executing the
loop's body. If the condition is false at the start, the loop's body will not
execute even once.
for and while loops check the condition before running the loop's body. If the
condition is false, the loop won't run. Therefore, they are entry controlled loops.
The body of the do-while loop executes at least once before checking the condition.
Hence, it is an exit controlled loop.
Question 1(xiv)
Method which reverses a given number is:
Impure method
Pure method
Constructor
Destructor
Answer
Pure method
Question 1(xv)
If the name of the class is "Yellow", what can be the possible name for its
constructors?
yellow
YELLOW
Yell
Yellow
Answer
Yellow
Reason — In Java, a constructor must have the same name as the class. It
initializes an object when it is created. Since the class name is Yellow, the
constructor's name must be exactly Yellow, matching the class name including
capitalization.
Question 1(xvi)
Invoking a method by passing the objects of a class is termed as:
Call by reference
Call by value
Call by method
Call by constructor
Answer
Call by reference
Question 1(xviii)
Assertion (A): Static method can access static and instance variables.
Reason — A static method can only access static variables and static methods
directly because it belongs to the class, not any specific object. Hence, Assertion
is false.
Both instance and static methods can access static variables. Hence, Reason is
false.
Question 1(xix)
What is the output of the Java code given below?
Reason — The given Java code declares and initializes a String array color with
three elements. The array elements are:
color[0] = "Blue"
color[1] = "Red"
color[2] = "Violet"
The method length() returns the number of characters in the string "Violet".
Question 1(xx)
Which of the following mathematical methods returns only an integer?
Math.ceil(n)
Math.sqrt(n)
Math.floor(n)
Math.round(n)
Answer
Math.round(n)
Reason — In Java, Math.round(n) is the only method in the list that returns an
integer when called with a floating-point number (float or double).
Question 2(i)
Write Java expression for:
𝑎
∣
𝑏
+
∣
a
2
+
b
2
a
2
+b
2
∣a+b∣
Answer
The Java expression for the given mathematical expression can be written as:
x += x++ * ++x % 2;
Answer
x += x++ * ++x % 2
x = x + (x++ * ++x % 2) (x = 4)
x = 4 + (4 * ++x % 2) (x = 5)
x = 4 + (4 * 6 % 2) (x = 6)
x = 4 + (24 % 2) (x = 6)
x = 4 + 0 (x = 6)
x = 4
Question 2(iii)
Rewrite the following do while program segment using for:
x = 10; y = 20;
do
{
x++;
y++;
} while (x<=20);
System.out.println(x * y );
Answer
System.out.println(x * y);
}
}
Question 2(iv)
Give the output of the following program segment. How many times is the loop
executed?
for(x=10; x>20;x++)
System.out.println(x);
System.out.println(x*2);
Answer
Output
20
The loop executes 0 times because the loop condition x>20 is false as value of x is
10.
Question 2(v)
String s1 = "45.50"; String s2 = "54.50";
double d1=Double.parseDouble(s1);
double d2=Double.parseDouble(s2);
int x= (int)(d1+d2);
What is value of x?
Answer
100
Reason — The code converts the strings "45.50" and "54.50" into doubles using
Double.parseDouble(), resulting in d1 = 45.5 and d2 = 54.5. Their sum is 100.0.
Casting 100.0 to an integer using (int) removes the decimal part, leaving x = 100.
Question 2(vi)
Consider the following two-dimensional array and answer the questions given below:
int x[ ][ ] = {{4,3,2}, {7,8,2}, {8, 3,10}, {1, 2, 9}};
(a) What is the order of the array?
Answer
x[0][0] = 4
x[2][2] = 10
x[0][0]+x[2][2] = 4 + 10 = 14
Question 2(vii)
Differentiate between boxing and unboxing.
Answer
Boxing Unboxing
It is the process of converting a primitive type to its corresponding wrapper class
object. It is the process of converting a wrapper class object back to its
corresponding primitive type.
It occurs when assigning a primitive value to a wrapper object. It occurs when
assigning a wrapper object to a primitive variable.
Example:
int num = 10;
Integer obj = num; Example:
Integer obj = 20;
int num = obj;
Question 2(viii)
The following code to compare two strings is compiled, the following syntax error
was displayed – incompatible types – int cannot be converted to boolean.
Identify the statement which has the error and write the correct statement. Give
the output of the program segment.
void calculate()
{
String a = "KING", b = "KINGDOM";
boolean x = a.compareTo(b);
System.out.println(x);
}
Answer
Output
false
Explanation
The error occurs in this line:
boolean x = a.compareTo(b);
The compareTo() method of the String class returns an int, not a boolean.
The method compares two strings lexicographically and returns:
0 if the strings are equal.
A positive value if the calling string is lexicographically greater.
A negative value if the calling string is lexicographically smaller.
Since an int cannot be assigned to a boolean variable, this causes a "incompatible
types" error.
To fix the error, we can use a comparison to convert the int result into a boolean:
Corrected Program:
void calculate() {
String a = "KING", b = "KINGDOM";
boolean x = (a.compareTo(b) == 0); // Check if strings are equal
System.out.println(x);
}
Output of the Program:
false
Question 2(ix)
Consider the given program and answer the questions given below:
class temp
{
int a;
temp()
{
a=10;
}
temp(int z)
{
a=z;
}
void print()
{
System.out.println(a);
}
void main()
{
temp t = new temp();
temp x = new temp(30);
t.print();
x.print();
}
}
(a) What concept of OOPs is depicted in the above program with two constructors?
(b) What is the output of the method main()?
Answer
10
30
Explanation:
t.print();
Prints value of a for t → 10
x.print();
Prints value of a for x → 30
Question 2(x)
Primitive data types are built in data types which are a part of the wrapper
classes. These wrapper classes are encapsulated in the java.lang package. Non
primitive datatypes like Scanner class are a part of the utility package for which
an object needs to be created.
(b) Write the statement to access the Scanner class in the program.
Answer
(a) java.lang
Section B
Question 3
DTDC a courier company charges for the courier based on the weight of the parcel.
Define a class with the following specifications:
Member variables:
Member methods:
void accept ( ) — to accept the details using the methods of the Scanner class
only.
void main ( ) — to create an object of the class and invoke the methods
import java.util.Scanner;
if (type == 'I') {
bill += 1500;
}
}
double perform (double r, double h) — to calculate and return the value of curved
surface area of cone
C
S
A
=
π
r
l
CSA=πrll=
r
2
+h
2
void perform (int r, int c) — Use NESTED FOR LOOP to generate the following format
r = 4, c = 5
output
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
void perform (int m, int n, char ch) — to print the quotient of the division of m
and n if ch is Q else print the remainder of the division of m and n if ch is R
Answer
import java.util.Scanner;
public class KboatOverloadPerform
{
double perform(double r, double h) {
double l = Math.sqrt((r * r) + (h * h));
double csa = Math.PI * r * l;
return csa;
}
// Generating pattern
mo.perform(4, 5);
(The number is said to be EvenPal number when number is palindrome number (a number
is palindrome if it is equal to its reverse) and sum of its digits is an even
number.)
Answer
import java.util.Scanner;
Example:
3 4 2 5
2 5 2 3
5 3 2 7
1 3 7 1
Answer
import java.util.Scanner;
int lSum = 0;
int rSum = 0;
if (lSum == rSum) {
System.out.println("The array is a DIAGONAL array.");
} else {
System.out.println("The array is NOT a DIAGONAL array.");
}
}
}
Output
BlueJ output of KboatDiagonalDDA.java
Question 7
Define a class pin code and store the given pin codes in a single dimensional
array. Sort these pin codes in ascending order using the Selection Sort technique
only. Display the sorted array.
Answer
int t = arr[i];
arr[i] = arr[idx];
arr[idx] = t;
}
System.out.println("Sorted Array:");
for (int i = 0; i < 8; i++)
{
System.out.print(arr[i] + " ");
}
}
}
Output
BlueJ output of Pincode.java
Question 8
Define a class to accept the gmail id and check for its validity.
→ @
→ .(dot)
→ gmail
→ com
Answer
import java.util.Scanner;
if (gmailId.endsWith("@gmail.com")
&& gmailId.indexOf('@') == len - 10)
{
System.out.println(gmailId + " is a valid Gmail ID.");
}
else
{
System.out.println(gmailId + " is NOT a valid Gmail ID.");
}
}
}
Output
BlueJ output of KboatValidateGmail.java
BlueJ output of KboatValidateGmail.java
BlueJ output of KboatValidateGmail.java
Prev
Solved 2025 Specimen Paper ICSE Class 10 Computer Applications
Next
Solved 2024 Specimen Paper ICSE Class 10 Computer Applications
Contents
Section A
Section B