ICSE Computer Applications 2026

 SECTION A (40 Marks)
(Attempt all questions from this section)

Question 1
Choose the correct answers to the questions from the given options.
(Do not copy the questions, write only the correct answers)

(i) The full form of JVM is:
(a) Java Visible Machine
(b) Java Virtual Mode
(c) Java Virtual Machine
(d) Java Visible Mode

(ii) Which of the following occupies 2 bytes of storage?
(a) 25
(b) AM
(c) 35.2
(d) \\

(iii) In a statement c = c + (x * d + e); which variable is an accumulator?
(a) d
(b) c
(c) e
(d) x

(iv) Which of the following is not an access specifier?
(a) private
(b) protected
(c) package
(d) public

(v) What is the output of the statement Math.pow(36, 6 / 5)?
(a) 36.0
(b) 1.0
(c) 73.71
(d) 6.0

(vi) Read the if program segment given below:
if(a > b)
    z = 25;
else
    z = 35;

Which one of the following is the correct conversion of the if program segment to ternary?
(a) z = a > b? 35 : 25;
(b) z = a > b? 25 : 35;
(c) z = a > b: 35 ? 25;
(d) z = a > b: 25 ? 35;

(vii) The output of the statement:
System.out.println(Character.toUpperCase('b') + 2); is:
(a) 66
(b) 100
(c) 68
(d) 98

(viii) Consider the following statements:
Computer desktop = new Computer();
Computer Mainframe = new Computer();

Name the objects of the class given above.
(a) Desktop, Mainframe
(b) desktop, Mainframe
(c) Computer, Mainframe
(d) Computer, desktop

(ix) The earth spins on its axis completing one rotation in a day. The earth revolves around the sun in 365 days to complete one revolution. What is the Java concept depicted in the given picture?
Rotation & Revolution of Earth
(a) Array
(b) Condition
(c) Nested loop
(d) While loop

(x) In the following method prototype to accept a character, an integer and return YES or NO, fill in the blank to complete the method prototype.
public ________ someMethod(char ch, int n)
(a) boolean
(b) String
(c) int
(d) double

(xi) In a calculator which Java feature allows multiple methods named calculate() for different operations?
(a) abstraction
(b) inheritance
(c) encapsulation
(d) polymorphism

(xii) Assertion (A): The result of the Java expression 3 + 7 / 2 is 6.
Reason (R): According to the hierarchy of operators in Java, addition is done first followed by division.
(a) (A) is true and (R) is false
(b) (A) is false and (R) is true
(c) Both (A) and (R) are true and (R) is the correct explanation of (A)
(d) Both (A) and (R) are true, but (R) is not the correct explanation of (A)

(xiii) What is the type of parameter to be given for the method parseInt()?
(a) double
(b) String
(c) char
(d) int

(xiv) To extract the word NOW from the word "ACKNOWLEDGEMENT", the Java statement "ACKNOWLEDGEMENT".substring(3, ________) is used. Choose the correct number to fill in the blank.
(a) 6
(b) 7
(c) 5
(d) 8

(xv) String a[] = {"Atasi", "Aditi", "Anant", "Amit", "Ahana"};
System.out.println(a[1].charAt(1) + "*" + a[2].charAt(2));

The output of the above statement is:
(a) da
(b) d * a
(c) ti
(d) t * i

(xvi) Which of the following String methods return a negative value?
(a) length()
(b) equals()
(c) compareTo()
(d) charAt()


(xvii) An array with 3 elements is arranged in ascending order as follows:








Name the technique used:
(a) Bubble sort
(b) Linear search
(c) Selection sort
(d) Binary search

(xviii) The sales made by 5 salesmen selling 5 products is stored in a two-dimensional array of integer data type. How many bytes does the array occupy?
(a) 25
(b) 200
(c) 50
(d) 100

(xix) Assertion (A): The substring() method modifies the original string.
Reason (R): The substring() method can extract part of a string starting from a specific index.
(a) (A) is true and (R) is false
(b) (A) is false and (R) is true
(c) Both (A) and (R) are true and (R) is the correct explanation of (A)
(d) Both (A) and (R) are true, but (R) is not the correct explanation of (A)

(xx) In constructor overloading, all constructors should have the same name as of the class but with a different set of ________.
(a) Access specifiers
(b) Classes
(c) Return type
(d) Parameters

Question 2
(i) Rewrite the following program segment using for loop:
int a = 5, b = 10;
while(b > 0){
    b -= 2;
}
System.out.println(a * b);

int a = 5, b = 10;
for(; b > 0; b -= 2);
System.out.println(a * b);

(ii) Evaluate the Java expression:
x = a * b % (++c) + (++a) + (--b);

if a = 7, b = 8, c = 2
x = 
a * b % (++c) + (++a) + (--b);
x = 7 * 8 % 3 + 8 + 7
x = 56 % 3 + 8 + 7
x = 2 + 8 + 7
x = 17

(iii) Write the Java expression to find the sum of cube root of x and the absolute value of y.
Math.cbrt(x) + Math.abs(y)

(iv) Users must be above 10 years to open a self-operated bank account. Write this logic using a ternary operator and store the result (the eligibility message) in a String variable named idStatus and print it.
String idStatus = (age > 10)? "ELIGIBLE" : "INELIGIBLE";
System.out.println(idStatus);

(v) Give the output of the following program segment:
String S = "GRACIOUS".substring(4);
System.out.println(S);
System.out.println("GLAMOROUS".endsWith(S));

IOUS
false

(vi) Give the output of the following program segment and mention how many times the loop is executed:
int K = 1;
do{
    K += 2;
    System.out.println(K);
}while(K <= 6);

OUTPUT:
3
5
7

The loop executes 3 times.

(vii) The following program segment calculates and displays the factorial of a number. Example: [Factorial of 5 is 1 ⨯ 2 ⨯ 3 ⨯ 4 ⨯ 5 = 120]
int p, n = 5, f = 0;
for(p = n; p > 0; p--)
    f *= p;
System.out.println(f);

Name the type of error if any. Correct the statement to get the desired output.

Logical Error.
int p, n = 5, f = 1;
for(p = n; p > 0; p--)
    f *= p;
System.out.println(f);

(viii) int X[][] = {{4, 5}, {7, 2}, {19, 4}, {7, 4}};
Write the index of the maximum element and the index of the minimum element of the array.

Maximum index = 2, 0
Minimum index = 1, 1

(ix) The following program segment swaps the first element and the second element of the given array without using the third variable. Fill in the blanks with appropriate Java statements:
void swap(){
    int x[] = {4, 8, 19, 24, 15};
    (1) ________;
    (2) ________;
    x[0] = x[0] / x[1];
    System.out.println(x[0] + " " + x[1]);
}

(1) x[0] = x[0] * x[1];
(2) x[1] = x[0] / x[1];

(x) Name the following:
(a) The return data type of the method equals().

boolean
(b) The String method which has no parameter and returns a string.
toUpperCase()

SECTION B (60 Marks)
(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
Define a class named StepTracker with the following specifications:
Member Variables:
String name: stores the user's name
int sw: stores the total number of steps walked by the user
double cb: stores the estimated calories burned by the user
double km: stores the estimated distance walked in kilometers
Member Methods:
void accept(): to input the name and the steps walked using Scanner class methods only
void calculate(): calculates calories burned and distance in km based on steps walked using the following estimation table:
Metric                    Calculation Formula
Calories Burned    steps walked * 0.04 (e.g. 1 step burns 0.04 calories)
Distance (km)        steps walked / 1300 (e.g. 1300 steps is approx. 1 km)
void display(): Display the calories burned, distance in km and the user's name.
Write a main() method to create an object of the class and invoke the methods.

import java.util.Scanner;
class StepTracker{
    String name;
    int sw;
    double cb;
    double km;
    public void accept(){
        Scanner in = new Scanner(System.in);
        System.out.print("Name: ");
        name = in.nextLine();
        System.out.print("Number of steps: ");
        sw = in.nextInt();
    }
    public void calculate(){
        cb = sw * 0.04;
        km = sw / 1300.0;
    }
    public void display(){
        System.out.println("Calories burned: " + cb);
        System.out.println("Distance: " + km + " km");
        System.out.println("Name: " + name);
    }
    public static void main(String[] args){
        StepTracker obj = new StepTracker();
        obj.accept();
        obj.calculate();
        obj.display();
    }
}

Question 4
Write a program to accept the designations of 100 employees in a single dimensional array. Accept the designation from the user and print the total number of employees with the designation given by the user as input.
Example:
Trainee    Manager    Chef    Manager    Director    Manager
Input:Manager            Output: 3

import java.util.Scanner;
class Employee{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        String d[] = new String[100];
        System.out.println("Enter 100 designations:");
        for(int i = 0; i < d.length; i++)
            d[i] = in.nextLine();
        System.out.print("Designation to be searched: ");
        String s = in.nextLine();
        int c = 0;
        for(int i = 0; i < d.length; i++){
            if(s.equalsIgnoreCase(d[i]))
                c++;
        }
        System.out.println(c + " such employees!");
    }
}

Question 5
Write a program to accept a two-dimensional integer array of order 4 
⨯ 5 as input from the user. Check if it is a Sparse Matrix or not. A matrix is considered to be a sparse, if the total number of zero elements is greater than the total number of non-zero elements. Print appropriate messages.
Example:
4    3    0    1    0
1    0    0    2    0
1    0    1    0    0
0    3    2    0    0
Number of zero elements = 11
Number of non-zero elements = 9
Matrix is a Sparse Matrix

import java.util.Scanner;
class Sparse{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int a[][] = new int[4][5];
        int z = 0;
        int nz = 0;
        System.out.println("Enter 20 integers:");
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 5; j++){
                a[i][j] = in.nextInt();
                if(a[i][j] == 0)
                    z++;
                else
                    nz++;
            }
        }
        if(z > nz)
            System.out.println("Sparse Matrix");
        else
            System.out.println("Not a Sparse Matrix");
    }
}

Question 6
Write a program to accept a number and check if it is a Mark number or not. A number is said to be Mark when the sum of the squares of each digit is an even number as well as the last digit of the sum and the last digit of the number given are same.
Example: n = 246
sum = 2 
⨯ 2 + 4 ⨯ 4 + 6 ⨯ 6 = 56
56 is an even number as well as last digit is 6 for both sum as well as the number.

import java.util.Scanner;
class Mark{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        System.out.print("Enter the integer: ");
        int n = in.nextInt();
        int sum = 0;
        for(int i = n; i != 0; i /= 10){
            int d = i % 10;
            sum += d * d;
        }
        if(sum % 2 == 0 && sum % 10 == n % 10)
            System.out.println(n + " is a Mark number!");
        else
            System.out.println(n + " is not a Mark number.");
    }
}

Question 7
Define a class to overload the method format() as follows:
void format(): To print the following pattern using nested for loops only:
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5
int format(String s): To calculate and return the sum of ASCII codes of each character of the string.
Example: CAB
Output: 67 + 65 + 66 = 198
void format(int n): To calculate and display the sum of natural numbers up to n given by the formula n(n + 1) / 2

class Overload{
    public static void format(){
        for(int i = 5; i >= 1; i--){
            for(int j = i; j <= 5; j++)
                System.out.print(j + " ");
            System.out.println();
        }
    }
    public static int format(String s){
        int sum = 0;
        for(int i = 0; i < s.length(); i++)
            sum += s.charAt(i);
        return sum;
    }
    public static void format(int n){
        int sum = n * (n + 1) / 2;
        System.out.println("Sum = " + sum);
    }
}

Question 8
Write a program to accept a word and print the Symbolic of the accepted word. Symbolic word is formed by extracting the characters from the first consonant, then add characters before the first consonant of the accepted word and end with "TR".
Example: AIRWAYS Symbolic word is RWAYSAITR
BEAUTY Symbolic word is BEAUTYTR

import java.util.Scanner;
class Symbolic{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        System.out.print("Enter the word: ");
        String w = in.next().toUpperCase();
        int pos = 0;
        for(int i = 0; i < w.length(); i++){
            char ch = w.charAt(i);
            if(Character.isLetter(ch) && "AEIOU".indexOf(ch) == -1){
                pos = i;
                break;
            }
        }
        String sym = w.substring(pos) + w.substring(0, pos) + "TR";
        System.out.println("Symbolic word is " + sym);
    }
}

Comments