Computer App 2025
Computer App 2025
COMPUTER APPLICATIONS
Class-10th
(Solved)
Maximum Marks: 100 Time Allotted: Two Hours
Instructions to Candidates:
1. Answers to this Paper must be written on the paper provided separately.
2. You will not be allowed to write during first 15 minutes.
3. This time is to be spent in reading the question paper.
4. The time given at the head of this Paper is the time allowed for writing the answers.
5. This Paper is divided into two Sections.
6. Attempt all questions from Section A and any four questions from Section B.
7. The intended marks for questions or parts of questions are given in brackets[].
Side 10
Stretch
}
static void main()
{ report r=new report();
r.print);
report p = new report(4, 5);
p.print();
}
}
(vi) (a) Name one String method which results in positive integer only. [2]
(b) Name one String method which results in a character.
(vii) John was asked to write a Java code to calculate the surface area of a cone, the following code was written [2]
by him:
Surface area of cone is A=πrl l = r 2 + h2
class area
{ double area (double r, double h)
{ double 1, a;
a=22.0/7*r*l;
l=Math.sqrt(r*r+h* h);
return a;
}
}
Specify the type of the error in the above program, correct and write the program to be error free.
(viii) Consider the following array and answer the questions given below: [2]
int a[] = {12, 10, 8, 4, 6 , 2, 3, 5, 7}
(a) What is the output of System.out.print(a[0]+a[5]);?
(b) What is the index (subscript) of the largest element of the array a[]?
(ix) (a) Write the Java statement to initialise the first 6 odd numbers in a 3 × 2 array. [2]
(b) What is the result of x[0][1]+x[2][1] of the above array?
(x) Give the output of the following program segment and specify how many times the loop is executed. [2]
String s = "JAYA";
for(i=0;i<s.length();i+=2)
System.out.println(s.substring(i);
SECTION B (60 Marks)
(Attempt 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.
solved PAPER - 2025 5
Question 3 [15]
Define a class named CloudStorage with the following specifications:
• Member Variables:
– int acno – stores the user's account number.
– int space – stores the amount of storage space in GB purchased by the user.
– double bill – stores the total price to be paid by the user.
• Member Methods:
– void accept() – prompts the user to input their account number and storage space using
Scanner class methods only.
– void calculate() – calculates the bill total price based on the storage space purchased using
the pricing table provided:
Storage range Price per GB (Rs)
First 15 GB 15
Next 15 GB 13
Above 30 GB 11
– void display() – displays the account number, storage space and bill to be paid.
Write a main method to create an object of the class and invoke the methods of the class with respect to
the object.
Question 4 [15]
Define a class to accept values into a 4 × 4 integer array. Calculate and print the NORM of the array.
NORM is the square root of sum of squares of all elements.
1 2 1 3
5 2 1 6
3 6 1 2
3 4 6 3
Sum of squares of elements = 1 + 4 + 1 + 9 + 25 + 4 + 1 + 36 + 9 + 36 + 1 + 4 + 9 + 16 + 36 + 9 = 201
NORM Squareroot of 201 = 14.177446878757825
Question 5 [15]
Define a class to accept a String and Print if it is a Super string or not. A String is Super if the number of
uppercase letters are equal to the number of lower case letters.
[Use Character & String methods only]
Example: "COmmlTmeNt"
Number of Uppercase letters −5
Number of Lowercase letters −5
String is a Super String
Question 6 [15]
Define a class to initialise the following data in an array.
Search for a given character input by the user, using the Binary Search technique.
Print "Search Successful" if the character is found otherwise print "Search is not Successful".
'A', 'H', 'N', 'P', 'S', 'U', 'W', 'Y', 'Z', 'b', 'd'
Question 7 [15]
Define a class to overload the method print() as follows:
void print()− To print the given format using nested loops.
@#@#@
@#@#@
@#@#@
@#@#@
@#@#@
double print(double a, double b)− To display the sum of numbers between a and b with difference of 0.5.
e.g. if a=1.0, b=4.0
output is: 1.0 + 1.5 + 2.0 + 2.5 + .................... +4.0
int print(char ch1, char ch2)− compare the two characters and return the ASCII code of the largest
character.
6 Oswaal ICSE Question Bank Chapterwise & Topicwise, COMPUTER APPLICATIONS, Class-X
Question 8 [15]
Define a class to accept a number. Check if the sum of the largest digit and the smallest digit is an even
number or an odd number. Print appropriate messages.
Sample Input: 6425 3748
Largest digit: 6 8
Smallest digit: 2 3
Sample Output: Sum is even Sum is odd
solved PAPER - 2025 7
Answers
Section A starts from 0 to n−1.
1. (i) Option (b) is correct. (xiv) Option (a) is correct.
Explanation: In Java, the Character class methods, Explanation: Since the hour hand moves 12 times
which provide functionalities for manipulating and with each iteration the minute hand moves for
characters, are located in the java.lang package. 60 times, it is a nested loop, loop inside loop.
(ii) Option (c) is correct. (xv) Option (d) is correct.
Explanation: ‘Z’ + 32 means ASCII code is 90. Explanation: Java does not consider the return type
90 + 32 = 122, which is printed. for method overloading. By changing the return
(iii) Option (d) is correct. type does not mean that the method is overloaded.
Explanation: The array carries [2, 5, 4.5, 5.5, 6.4], Hence, void test (int a) and int test (int a) causes a
which means 2 integers and 3 doubles, So, total compile time error.
memory occupied will be 2 × 4 + 3 × 8 = 8 + 24 (xvi) Option (c) is correct.
= 32 bytes. Explanation: The Double.parseDouble(“25”) con-
(iv) Option (a) is correct. verts the string “25” to double 25.0.
Explanation: 42/6%2 = 7%2 = 1. (xvii) Option (d) is correct.
(v) Option (a) is correct. Explanation: Since there are no statements in the
Explanation: The element is in row index 1 and loop, no values of p are printed inside the loop.
column index 1, so P[1, 1]. When the loop ends p has become 0.
(vi) Option (b) is correct. The last two print statements print the value of p,
Explanation: Arrays and classes are user defined that is 00.
data types in java. Both can hold multiple data (xviii) Option (b) is correct.
elements. Explanation: The ‘\’ escape sequence hides the
(vii) Option (b) is correct. special meaning of character.
Explanation: The loop is for (i=2; I!=0; I−=3), (xix) Option (c) is correct.
starting from value 2 , if I is decreased by 3 every Explanation: Here the compareTo() compares the
time, it will never reach 0, hence it is an infinite strings “ANGEL” and “ANGER” and gives the
loop. difference in ASCII codes of the differentiating
(viii) Option (a) is correct. characters ‘L’ and ‘R’:
Explanation: Math.min(−5, −4) gives −5 and "ANGER" vs "ANGEL":
Math.max(−7, −5) gives −5. • 'A' == 'A' → equal
(ix) Option (c) is correct. • 'N' == 'N' → equal
Explanation: Cricket is an object of the Game class, • 'G' == 'G' → equal
created using the new operator in the statement • 'E' == 'E' → equal
Game cricket = new Game(); • 'R' vs 'L' → 'R' (82) − 'L' (76) = 6
(x) Option (a) is correct. (xx) Option (b) is correct.
Explanation: A public access specifier allows a class, Explanation: First the variables are initialised. Next
method, or variable to be accessed from anywhere the loop starts, and then the value of k is repeatedly
in the program. multiplied with the return variable ‘fa’. Finally, the
A Post Office is a public service that is accessible to return value is returned.
everyone, similar to how the public access modifier 2. (i) Math.sqrt(P) * Math.sqrt(Q)
makes members accessible to all parts of a program. (ii) ‘entrix”
(xi) Option (a) is correct. Explanation: x.substring(3) returns characters
Explanation: Because of the break statement control from index 3 to the end of x, giving “ent”, similarly
of execution goes out of the switch….case construct y.substring(3) returns characters from index 3 to the
and fall through is avoided and also the valid end of y giving ‘rix’. Both are concatenated.
matching case(s) are executed. (iii) Robot Sifra=new Robot(77.213, 182.668, 919.817);
(xii) Option (c) is correct. (iv) int a,b;
Explanation: Since the work done here is repetitive a=10;
in nature, the for programming construct is used
b=1;
here.
do
(xiii) Option (d) is correct.
{
Explanation: ar.length gives the last position and
b+=a;
−1 gives the actual index, as the index of the array
8 Oswaal ICSE Question Bank Chapterwise & Topicwise, COMPUTER APPLICATIONS, Class-X
8. import java.util.*;
lg=d;
public class LargestSmallest
if (d<sg)
{
sg=d;
public static void main(String args[]) {
num/=10;
{
}
Scanner sc=new Scanner(System.in);
System.out.println("Largest digit :"+lg);
System.out.println("Enter number :");
System.out.println("Smallest digit :"+sg);
int d,lg=0,sg=0,num;
if ((sg+lg)%2==0){
num=sc.nextInt();
System.out.println("Sum of largest and smallest
lg=num%10; digits is even");
sg=num%10;
}else {
while (num>0)
System.out.println("Sum of largest and smallest
{ digits is odd");
d=num%10; }
if (d>lg)
}
}