Improvement Paper2025

ICSE Class 10 Computer Applications — 2025 Improvement

36 solved questions from Solved 2025 Improvement Paper ICSE Class 10 Computer Applications. Every answer follows the ICSE marking scheme.

Section
Marks
Insight
1(i)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Which of the following String methods results into boolean data type?

Show SolutionHide Solution↓

equals()

Reason — In Java, the equals() method compares the contents of two strings and returns a boolean value (true or false), whereas trim(), replace(), and concat() return new strings, not boolean values.

1(ii)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Which construct can be used to get only one of the required ice creams?

which construct can be used to get only one of the required ice creams. ICSE 2025 Computer Applications Solved Question Paper.
Show SolutionHide Solution↓

switch construct

Reason — The switch construct can be used to select and execute only the case that matches the required ice cream choice, skipping all other cases, which makes it suitable when only one specific ice cream needs to be selected from several options.

1(iii)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Which statement is correct for the method prototype given below:

int check(char ch, String s)

Show SolutionHide Solution↓

check() has return type int

Reason — In the method prototype int check(char ch, String s), the keyword int before the method name specifies that the method returns an integer value. The parameters char ch and String s are formal parameters, and the method is not a constructor as it has a return type.

1(iv)1 Mark · 2025 · Section A · 2025 ImprovementFull page

The Math method which returns int value is:

Show SolutionHide Solution↓

round()

Reason — The round() method returns an int. Other methods like cbrt() and ceil() return double, while random() returns a double value between 0.0 and 1.0.

1(v)1 Mark · 2025 · Section A · 2025 ImprovementFull page

What is the output of the following statement:

“MONOPOLY”.lastIndexOf(‘O’);

Show SolutionHide Solution↓

5

Reason — In the string "MONOPOLY", the character 'O' occurs at indexes 1, 3, and 5 (indexing starts from 0). The lastIndexOf('O') method returns the last occurrence of 'O', which is at index 5.

1(vi)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Typecasting is often necessary when dealing with financial data. Identify the correct syntax to typecast a double to an int using the variables:

int amount; double valueINR

Show SolutionHide Solution↓

int amount = (int) valueINR;

Reason — The correct syntax to typecast a double to an int in Java is by placing (int) before the double variable, which converts it to an integer by removing its decimal part.

1(vii)1 Mark · 2025 · Section A · 2025 ImprovementFull page

What is the output of the code snippet given below?

int lives = 5;
System.out.print(lives--);
System.out.print(lives);
Show SolutionHide Solution↓

5 4

Reason — In System.out.print(lives--), the post-decrement operator (lives--) prints the current value of lives (which is 5) first, then decreases it to 4. The next System.out.print(lives) prints the updated value 4.

1(viii)1 Mark · 2025 · Section A · 2025 ImprovementFull page

What will be the output of the following statement?

String s = "JavaProgramming";
System.out.println(s.substring(4, 11).toUpperCase());
Show SolutionHide Solution↓

PROGRAM

Reason — In the string "JavaProgramming", indexing starts at 0. substring(4, 11) extracts characters from index 4 to 10, which is "Program". Calling .toUpperCase() converts it to "PROGRAM".

1(ix)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Which of the following access specifiers will make a member accessible only within its own class?

Show SolutionHide Solution↓

private

Reason — In Java, the private access specifier restricts a member’s visibility so it can be accessed only within the same class where it is declared.

1(x)1 Mark · 2025 · Section A · 2025 ImprovementFull page

What will be the output of the following Java method?

Character.isLetterOrDigit('\n')
Show SolutionHide Solution↓

false

Reason — The method Character.isLetterOrDigit('\n') checks whether the given character is a letter or a digit. The character '\n' represents a newline, which is neither a letter nor a digit, so the method returns false.

1(xi)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Which of the following is not a type of token in Java?

1. Method3. Literal
2. Identifier4. Keyword
Show SolutionHide Solution↓

only 1

Reason — In Java, the main types of tokens are keywords, identifiers, literals, operators, and separators. A method is not considered a token; it is a block of code that performs a task.

1(xii)1 Mark · 2025 · Section A · 2025 ImprovementFull page

The statement given below is termed as:

public void Accept(int a)

Show SolutionHide Solution↓

Method prototype

Reason — In Java, a method prototype specifies the method’s access specifier, return type, name, and parameter list without including its body. The statement public void Accept(int a) shows these elements but does not contain a method body, so it is a method prototype.

1(xiii)1 Mark · 2025 · Section A · 2025 ImprovementFull page

What is the output of the following Java code?

boolean flag = false; 
if (flag) { 
System.out.println("True"); 
} else { 
System.out.println("False"); 
}
Show SolutionHide Solution↓

False

Reason — The code declares a boolean variable flag with the value false, checks it in the if condition, and since it evaluates to false, the if block is skipped and the else block executes, printing False to the output.

1(xiv)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Identify the static method from the list given below:

Show SolutionHide Solution↓

isLetter(char)

Reason — The method isLetter(char) belongs to the Character class and is a static method, meaning it can be called using the class name without creating an object. The other methods (length(), nextLine(), substring(int)) are instance methods that require an object to be invoked.

1(xv)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Which one of the following will be the output of the below statements?

String a[]={"Rohini", "Rajarshi", "Rajeev", "Rehan", "Rebecca"}; 
System.out.println(a[2].substring(2));
Show SolutionHide Solution↓

jeev

Reason — In the array, the element at position 2 is "Rajeev". In Java, string indexing starts from 0, so index 0 = R, index 1 = a, and index 2 = j. Using substring(2) means we take all characters from index 2 to the end, giving "jeev".

1(xvi)1 Mark · 2025 · Section A · 2025 ImprovementFull page

System.out.println(Math.round(Math.ceil(-8.8))); will result in:

Show SolutionHide Solution↓

-8

Reason — First, Math.ceil(-8.8) returns -8.0 because ceil() rounds a number up to the nearest integer (for negative numbers, “up” means closer to zero). Then, Math.round(-8.0) returns the integer -8, as round() converts a floating-point number to the nearest whole number.

1(xvii)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Which one of the following Java statements assign 100 to the last element of a 3 × 3 array?

Show SolutionHide Solution↓

x[2][2]=100;

Reason — In Java, array indexing starts from 0, so a 3 × 3 array has valid row and column indices 0, 1, and 2. The last element is at row index 2 and column index 2, so x[2][2] = 100; correctly assigns the value 100 to that element.

1(xviii)3 Marks · 2025 · Section A · 2025 ImprovementFull page

Consider the Two dimensional array S[2], of storage devices given below, state the index of the Hard disk.

Consider the Two dimensional array S[2][3], of storage devices given below, state the index of the Hard disk? ICSE 2025 Computer Applications Solved Question Paper.
Show SolutionHide Solution↓

S[1][0]

Reason — In a two-dimensional array S[2][3], the first index represents the row and the second index represents the column, both starting from 0. Based on the given arrangement of storage devices, the element "Hard disk" is located in the second row (index 1) and first column (index 0), so its index is S[1][0].

1(xix)1 Mark · 2025 · Section A · 2025 ImprovementFull page

How many times the for statement given below is executed?

for(k = 10; k >= 0; k--)

Show SolutionHide Solution↓

11

Reason — The loop starts with k = 10 and runs while k >= 0. This includes both k = 10 and k = 0, so the values of k will be: 10, 9, 8, ..., 1, 0 — a total of 11 iterations.

1(xx)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Consider the following program segment in which the statements are jumbled. Choose the correct order of the statements to return the sum of first 10 natural numbers.

for(i=1; i<=10; i++)  → 1
return sum;           → 2
int sum = 0, i;       → 3
sum+=i;               → 4
Show SolutionHide Solution↓

3 1 4 2

Reason — To return the sum of first 10 natural numbers, we must follow the proper sequence of statements:

  1. int sum = 0, i; – Declare the variables sum and i, and initialize sum to 0.
  2. for(i=1; i<=10; i++) – Start the loop to go through numbers 1 to 10.
  3. sum+=i; – Add the current number i to sum during each loop iteration.
  4. return sum; – After the loop completes, return the total sum.
2(i)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Write Java expression for the following:

$x^{10} + y^{10}$

Show SolutionHide Solution↓

Math.pow(x, 10) + Math.pow(y, 10)

2(ii)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Evaluate the given expression when x = 4.

x *= --x + x-- + x;

Show SolutionHide Solution↓

x *= --x + x-- + x
x = x * (--x + x-- + x)
x = 4 * (--x + x-- + x)
x = 4 * (3 + x-- + x)
x = 4 * (3 + 3 + x)
x = 4 * (3 + 3 + 2)
x = 4 * 8
x = 32

2(iii)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Convert the following switch case into if else if:

switch(x) 
{ 
case 'T' : 
case  't'  : System.out.print("Teacher");  break; 
default  :  System.out.print("Student");   
}
Show SolutionHide Solution↓
if (x == 'T' || x == 't') {
    System.out.print("Teacher");
} else {
    System.out.print("Student");
}
2(iv)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Write the output of the following program segment:

for(int a = 1; a <= 10; a++) 
{ 
if(a % 2 == 0) 
continue; 
System.out.print(a + "  "); 
}
Show SolutionHide Solution↓
1  3  5  7  9
  1. The loop control variable a is initialized to 1 and is incremented by 1 after each iteration until it attains the value 10.
  2. The condition if (a % 2 == 0) tests whether a is an even number. If the condition is true, the continue statement transfers control to the next iteration of the loop, thereby skipping the print statement.
  3. Consequently, only the odd values 1, 3, 5, 7, and 9 are displayed by the statement System.out.print(a + " ");.
2(v)1 Mark · 2025 · Section A · 2025 ImprovementFull page

In the example given below of class Cat, identify the variable and the methods:

Cat
Name
meow()
eat()
play()
Show SolutionHide Solution↓

Variable: Name

Methods: meow(), eat(), play()

2(vi)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Give the output of the following program segment and mention how many times the loop is executed.

int k = 100; 
while (k>=10) 
{
    System.out.println(k); 
    k-=40; 
}
Show SolutionHide Solution↓
100
60
20

The loop is executed 3 times.

  • Initial value: k = 100 → printed, then reduced to 60.
  • Second iteration: k = 60 → printed, then reduced to 20.
  • Third iteration: k = 20 → printed, then reduced to -20.
  • Loop stops when k < 10.
2(vii)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Consider the given array and answer the questions given below:

int z[ ] [ ] = { {2, 3, 4}, {5, 1, 2}, {7, 9, 3}};

(a) What is the order of the array z[ ][ ]?

(b) What is the value in z[2][0]?

Show SolutionHide Solution↓

(a) The order of the array z[ ][ ] is 3 × 3.

(b) The value in z[2][0] is 7.

2(viii)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Give the output of the following:

(a) "ROSE".compareTo("ROJA")

(b) "DEDICATE".replace('D', 'L')

Show SolutionHide Solution↓

(a)

9

The method compareTo() compares two strings lexicographically by evaluating the Unicode value of each character from left to right until a mismatch is found.

  1. 'R' (82) vs 'R' (82) → same.
  2. 'O' (79) vs 'O' (79) → same.
  3. 'S' (83) vs 'J' (74) → difference = 83 - 74 = 9.

Since a mismatch occurs at the third character, the comparison stops; therefore, the characters 'E' and 'A' are not compared.

Hence, the method returns 9.

(b)

LELICATE

The replace('D', 'L') method substitutes every occurrence of the character 'D' in the string "DEDICATE" with 'L', resulting in "LELICATE".

2(ix)1 Mark · 2025 · Section A · 2025 ImprovementFull page

Consider the following array and answer the questions given below:

char ch [ ] = { ‘A’, ‘%’, ‘y’, ‘@’, ‘7’, ‘p’};

(a) How many bytes does the array occupy?

(b) What is the output of the statement Character.isDigit(ch[4])?

Show SolutionHide Solution↓

(a) In Java, each element of type char occupies 2 bytes of memory. The given array has 6 elements, therefore:

Total memory = 6 × 2 = 12 bytes.

(b)

true
  • The element ch[4] contains the character '7'.
  • The method Character.isDigit('7') returns true because '7' is a numeric digit.
2(x)1 Mark · 2025 · Section A · 2025 ImprovementFull page
class perform 
{ 
int  m;  String name; 
perform(int x, String y) 
{ 
m=x; 
name=y; 
} 
void print()  
{ 
System.out.print(name + "     " + m); 
}      
public static void main() 
{ 
perform ob1=new perform(95 , "Xavier"); 
ob1.print();
} 
}

(a) Give the output of the code given above.

(b) Name the type of the constructor used.

Show SolutionHide Solution↓

(a)

Xavier     95
  • A perform object ob1 is created using new perform(95, "Xavier").
  • The constructor assigns m = 95 and name = "Xavier".
  • The print() method outputs the name followed by spaces and then m.

(b) The constructor perform(int x, String y) accepts arguments, hence it is a parameterized constructor.

3Written · 2025 · Section B · 2025 ImprovementFull page

Define a class with following specifications.
class name: Hotel
Member variables:
String name – stores name of customer name
long mobno – stores mobile number
int days – stores number of days customer stayed in hotel
int bill – stores customer bill

Member method:
void input() – input values using Scanner class methods only
void charge() – calculate bill as per the following criteria

dayscharge/day
first 3 days1000 Rs/ day
next 4 days900 Rs/day
> 7 days800 Rs/day

bill = bill + gst (18% of bill)

void print() - Display customer name, mobile number and bill.

Invoke all the above methods in main method with the help of an object.

Show SolutionHide Solution↓
import java.util.Scanner;

class Hotel {
    String name;
    long mobno;
    int days;
    int bill;

    void input() {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter customer name: ");
        name = sc.nextLine();
        System.out.print("Enter mobile number: ");
        mobno = sc.nextLong();
        System.out.print("Enter number of days stayed: ");
        days = sc.nextInt();
    }

    void charge() {
        if (days <= 3) {
            bill = days * 1000;
        } else if (days <= 7) {
            bill = (3 * 1000) + (days - 3) * 900;
        } else {
            bill = (3 * 1000) + (4 * 900) + (days - 7) * 800;
        }
        bill += bill * 0.18;
    }

    void print() {
        System.out.println("Customer Name : " + name);
        System.out.println("Mobile Number : " + mobno);
        System.out.println("Total Bill    : Rs " + bill);
    }

    public static void main(String[] args) {
        Hotel h = new Hotel();
        h.input();
        h.charge();
        h.print();
    }
}
BlueJ output of Hotel.java
4Written · 2025 · Section B · 2025 ImprovementFull page

Define a class to accept values into a 3x3 integer array and print the product of each row elements.

Example:

312
421
512

Output:

Row 0 – 6
Row 1 – 8
Row 2 – 10

Show SolutionHide Solution↓
import java.util.Scanner;

public class RowProduct {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] arr = new int[3][3];

        System.out.println("Enter 9 integers for the 3x3 array:");
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                arr[i][j] = sc.nextInt();
            }
        }

        for (int i = 0; i < 3; i++) {
            int product = 1;
            for (int j = 0; j < 3; j++) {
                product *= arr[i][j];
            }
            System.out.println("Row " + i + " – " + product);
        }
    }
}
BlueJ output of RowProduct.java
5Written · 2025 · Section B · 2025 ImprovementFull page

Define a class to overload the method transform as follows:

int transform(int n) – to return the sum of the digits of the given number

Example: n = 458
output : 17

void transform(String s) – to convert the given String to upper case and print

Example: if S = “Blue”
Output : BLUE

void transform (char ch) – to print the character ch in 3 rows and 3 columns using nested loops.

Example: if ch = ‘@’
Output :

Show SolutionHide Solution↓
@@@  
@@@
@@@
import java.util.Scanner;

public class OverloadTransform {

    int transform(int n) {
        int sum = 0;
        while (n > 0) {
            int d = n % 10;
            sum += d;
            n /= 10;
        }
        return sum;
    }

    void transform(String s) {
        String str = s.toUpperCase();
        System.out.println(str);
    }

    void transform(char ch) {
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(ch);
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        OverloadTransform obj = new OverloadTransform();

        System.out.print("Enter an integer: ");
        int num = sc.nextInt();
        System.out.println("Sum of digits: " + obj.transform(num));

        sc.nextLine();
        System.out.print("Enter a string: ");
        String str = sc.nextLine();
        obj.transform(str);

        System.out.print("Enter a character: ");
        char ch = sc.next().charAt(0);
        obj.transform(ch);
    }
}
BlueJ output of OverloadTransform.java
6Written · 2025 · Section B · 2025 ImprovementFull page

Define a class to accept a string. Check if it is a Special String or not.
A String is Special if the number of vowels equals to the number of consonants.
Example: MINE
Number of vowels = 2
Number of Consonants = 2

Show SolutionHide Solution↓
import java.util.Scanner;

public class SpecialString {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        System.out.print("Enter a string: ");
        String str = sc.nextLine().toUpperCase();

        int vowels = 0, consonants = 0;
        int len = str.length();

        for (int i = 0; i < len; i++) {
            char ch = str.charAt(i);
            if (ch >= 'A' && ch <= 'Z') {
                if (ch == 'A' 
                    || ch == 'E' 
                    || ch == 'I' 
                    || ch == 'O' 
                    || ch == 'U')
                    vowels++;
                else
                    consonants++;
            }
        }

        System.out.println("Number of vowels = " + vowels);
        System.out.println("Number of consonants = " + consonants);

        if (vowels == consonants)
            System.out.println("It is a Special String");
        else
            System.out.println("It is not a Special String");
    }
}
BlueJ output of SpecialString.java BlueJ output of SpecialString.java
7Written · 2025 · Section B · 2025 ImprovementFull page

Define a class to accept a number and check if the sum of the first digit and the last digit is an even number or an odd number.

Example:

Show SolutionHide Solution↓
            N = 2396    N = 9316
First digit:   2         9
Last digit:    6         6
Sum:           8         15
Output: Sum is even  Sum is odd
import java.util.Scanner;

public class FirstLastSum {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        System.out.print("Enter a number: ");
        int n = sc.nextInt();

        int lastDigit = n % 10;
        int firstDigit = n;
        while (firstDigit >= 10) {
            firstDigit /= 10;
        }

        int sum = firstDigit + lastDigit;

        System.out.println("First digit: " + firstDigit);
        System.out.println("Last digit: " + lastDigit);
        System.out.println("Sum: " + sum);

        if (sum % 2 == 0)
            System.out.println("Sum is even");
        else
            System.out.println("Sum is odd");
    }
}
BlueJ output of FirstLastSum.java BlueJ output of FirstLastSum.java
8Written · 2025 · Section B · 2025 ImprovementFull page

Define a class to accept 10 integers in an array, search for the given value using the Linear Search technique and print appropriate messages.

Show SolutionHide Solution↓
import java.util.Scanner;
public class LinearSearchArray {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[10];

        System.out.println("Enter 10 integers:");
        for (int i = 0; i < 10; i++) {
            arr[i] = sc.nextInt();
        }
        System.out.print("Enter the value to search: ");
        int key = sc.nextInt();
        int i = 0;

        for (i = 0; i < 10; i++) {
            if (arr[i] == key) {
                break;
            }
        }
        
        if (i < 10)
            System.out.println("Value found at position: " + (i + 1));
        else
            System.out.println("Value not found in the array");
    }
}
BlueJ output of LinearSearchArray.java BlueJ output of LinearSearchArray.java

Press ↓ to reveal a solution and move to the next question. Browse the free sample bank.

All 357 Computer Applications questions