Sample PapersICSEClass 10Computer Applications

ICSE Class 10 Computer Applications Evaluation II Sample Paper 2026-27 with Solutions

A full ICSE Class 10 Computer Applications Evaluation II paper for 2026-27 on methods, constructors, wrapper classes, strings and loops, with a checked answer key, output working and six solved Java programs.

14 min read
ICSE Class 10 Computer Applications Evaluation II Sample Paper 2026-27 with Solutions

This is a full ICSE Class 10 Computer Applications Evaluation II paper for 2026-27, followed by a complete answer key that has been checked question by question. It covers user-defined methods and overloading, constructors, wrapper classes, string handling, loops and nested loops, the same chapters that carry most of the marks in the board exam.

Attempt it in 2 hours, then check your answers. Output questions show their working, and all six Section B programs have full BlueJ-ready solutions.

Diagram showing how LION and KING are merged into LK#%#NNG
Question 4: characters are taken alternately from the two words, and vowels are replaced.

COMPUTER APPLICATIONS – EVALUATION II (2026-27)

Class X | Maximum Marks: 100 | Time Allowed: Two Hours

Attempt all questions from Section A and any four questions from Section B. The intended marks for questions or parts of questions are given in brackets [ ].

SECTION A (40 Marks)

Question 1 – Choose the correct answer [20]

(i) Name the programming construct used by the teacher in the following picture.

Teacher pointing at a blackboard that says learn this formula until the bell rings
Question 1 (i)
  • (a) do-while
  • (b) while
  • (c) for
  • (d) if-else

(ii) System.out.print(20 + 50 + "70"); will print:

  • (a) 140
  • (b) 7070
  • (c) 20120
  • (d) 205070

(iii) Which of the following is not allowed in Java? 1. Constructor overloading 2. A switch variable of type double 3. Keywords in upper case 4. Declaring variables outside of any method

  • (a) Only 1
  • (b) 2 and 3
  • (c) 3 and 4
  • (d) 1 and 4

(iv) The output of System.out.println("CHATBOT".compareTo("CHAT")); is:

  • (a) BOT
  • (b) 3
  • (c) -1
  • (d) false

(v) Float var = 25.9f; This statement is a proper example of:

  • (a) Wrapper class assignment
  • (b) Variable initialisation
  • (c) Autoboxing
  • (d) Syntax error

(vi) A method with the return type void is certainly a/an _______ method.

  • (a) Library
  • (b) Pure
  • (c) Impure
  • (d) Class

(vii) Which statement is correct for the method prototype int check(char ch, String s)?

  • (a) check() does not return any value
  • (b) check() has return type int
  • (c) check() has three actual parameters
  • (d) check() is a constructor

(viii) The Math method which returns an int value is:

  • (a) round()
  • (b) cbrt()
  • (c) ceil()
  • (d) random()

(ix) What is the output of "MONOPOLY".lastIndexOf('O')?

  • (a) 1
  • (b) 3
  • (c) 2
  • (d) 5

(x) The keyword used to access the members of another package is:

  • (a) object
  • (b) import
  • (c) public
  • (d) static

(xi) Task myTask = new Task(); Here myTask is a/an:

  • (a) Class
  • (b) Object
  • (c) Constructor
  • (d) Object reference variable

(xii) Assertion (A): When two or more loops are defined in a program, it is said to be a nested loop. Reason (R): In a nested iterative structure, the inner loop gets executed for each of the outer loop executions.

  • (a) Both A and R are true and R is a correct explanation of A
  • (b) Both A and R are true and R is not a correct explanation of A
  • (c) A is false and R is true
  • (d) A is true and R is false

(xiii) How many times will the following loop execute?

for (int r = 1; r > 1; r--)
    System.out.println(r);
  • (a) 1
  • (b) 0
  • (c) Infinite
  • (d) Syntax error

(xiv) Which of the following methods returns a boolean value?

  • (a) equals()
  • (b) trim()
  • (c) compareTo()
  • (d) charAt()

(xv) Predict the output of (int)(Math.cbrt(512) + Math.pow(-64, 1/3)):

  • (a) 9
  • (b) 64
  • (c) 8
  • (d) 12

(xvi) Assertion (A): The use of the default case in a switch construct is optional. Reason (R): Statements under the default case are executed only if none of the case labels matches the value of the switch variable.

  • (a) Both A and R are true and R is a correct explanation of A
  • (b) Both A and R are true and R is not a correct explanation of A
  • (c) A is true and R is false
  • (d) A is false and R is true

(xvii) Identify the incorrect return statement:

  • (a) return 0;
  • (b) return (x);
  • (c) return (x, y);
  • (d) return;

(xviii) State the type of loop in the given snippet: int a = 1; while (true) a++;

  • (a) Fixed loop
  • (b) Null loop
  • (c) Finite loop
  • (d) Infinite loop

(xix) Which method converts a String into an int?

  • (a) Integer.toString()
  • (b) Integer.parseInt()
  • (c) Integer.valueOfString()
  • (d) Integer.convert()

(xx) The statements marked Line 1 to Line 4 below are jumbled. Choose the order that prints the total number of proper factors of the number stored in num.

int i = 1, c = 0;
while (i < num)
{
    c += 1;                  // Line 1
    if (num % i == 0)        // Line 2
    System.out.println(c);   // Line 3
}
i += 1;                      // Line 4
  • (a) (2) (4) (3) (1)
  • (b) (2) (1) (4) (3)
  • (c) (3) (2) (1) (4)
  • (d) (4) (3) (2) (1)

Question 2 [20]

(i) Write a Java statement to find the minimum of xʸ and yˣ using methods of the Math class.

(ii) Evaluate the following expression when c = 2: c -= --c / c++ - ++c;

(iii) Convert the following while loop into a for loop so that all the constants and the output remain unchanged:

int i = 1;
while (++i <= 10)
{
    System.out.println(i);
}

(iv) Predict the output:

String s1 = "100.78";
String s2 = "200";
int a1 = (int) Double.parseDouble(s1);
int a2 = Integer.valueOf(s2);
System.out.println(a1 + a2);

(v) Write two features of constructors.

(vi) Predict the output of the following program:

public class Galaxy
{
    private int spin = 97;
    private String volume = "Medium";
    Galaxy()
    {
        System.out.println("Extreme axial tilt");
    }
    Galaxy(int angle, String size)
    {
        spin = angle;
        volume = size;
    }
    void show()
    {
        System.out.println("Inclination Angle: " + spin);
        System.out.println("Volume: " + volume);
    }
    public static void main(String args[])
    {
        Galaxy uranus = new Galaxy();
        uranus.show();
        Galaxy mars = new Galaxy(25, "Small");
        mars.show();
    }
}

(vii) Analyse the following loop and answer with working: (a) How many times does the loop execute? (b) What is the output?

String x = "INTELLIGENCE";
for (int i = 0; i < x.length(); i++)
{
    if (i % 2 == 0)
        continue;
    System.out.println(x.charAt(i));
}

(viii) 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");
}

(ix) Write the output of the following program segment:

for (int a = 1; a <= 10; a++)
{
    if (a % 2 == 0)
        continue;
    System.out.print(a + "  ");
}

(x) Give the output of: (a) "ROSE".compareTo("ROJA") (b) "DEDICATE".replace('D', 'L')

SECTION B (60 Marks)

Answer any four questions. Write each program with variable descriptions or mnemonic names so that the logic is clear. Flowcharts and algorithms are not required.

Question 3 [15]

Define a class Discount with the following description:

  • Data members: int cost (price of the article), String name (customer name), double dc (discount), double amt (amount to be paid)
  • void input(): accepts the cost of the article and the name of the customer
  • void calc(): calculates the discount and the amount to be paid
  • void display(): displays the name, cost, discount and amount to be paid

Compute the discount using the following slab. The original paper did not print the slab, so this standard ICSE slab is used:

Discount slab
Cost (Rs.)            Discount
Up to 5000            Nil
5001 to 10000         10%
10001 to 15000        15%
Above 15000           20%

Display the output in the format: Name of the customer | Discount | Amount.

Question 4 [15]

Define a class to accept two words of the same length, convert them into upper case and form a new string in which the first character of the first word is followed by the first character of the second word, and so on. All vowels of the first word are replaced by '#' and all vowels of the second word are replaced by '%' in the output string. Display both input words and the output string.

Example: First word – LION, Second word – KING → Output string – LK#%#NNG

Question 5 [15]

(a) Write a program to print the following pattern:

P
PR
PRO
PROG
PROGR
PROGRA
PROGRAM

(b) Write a program to print the sum of the series X¹ + X² + X³ + … + Xⁿ.

Question 6 [15]

Define a class to overload the method transform as follows:

  • int transform(int n): returns the sum of the digits of n. Example: n = 458 → 17
  • void transform(String str, char ch, char ch1): replaces ch with ch1 in str and prints it. Example: "Banana", 'n', 't' → Batata
  • void transform(String str, char ch): counts and prints the frequency of ch in str. Example: "program", 'r' → 2

Question 7 [15]

Define a class to accept a string and check whether it is a Special String. A string is special if its number of vowels equals its number of consonants. Example: MINE has 2 vowels and 2 consonants, so it is special.

Question 8 [15]

An Oddtastic number is a natural number all of whose digits are odd. Design a class to accept a natural number, check whether it is an Oddtastic number and display the result. Example: 3795 is Oddtastic. 295 is not, because it contains the even digit 2.

ANSWER KEY WITH SOLUTIONS

Question 1 – MCQ answers

  • (i) (b) while: the number of repetitions is not known in advance. The teacher repeats until a condition (the bell) occurs, which is an entry-controlled, condition-based loop.
  • (ii) (b) 7070: 20 + 50 is evaluated first as numbers (70), then joined with "70".
  • (iii) (b) 2 and 3: a switch cannot work on a double, and keywords must be in lower case. Constructor overloading and declaring fields outside methods are both allowed.
  • (iv) (b) 3: "CHAT" is a prefix of "CHATBOT", so compareTo() returns the difference in lengths, 7 − 4 = 3.
  • (v) (c) Autoboxing: the primitive float value 25.9f is automatically wrapped into a Float object.
  • (vi) (c) Impure: a void method returns nothing, so it is only useful through a side effect (printing or changing data), which makes it impure.
  • (vii) (b) check() has return type int.
  • (viii) (a) round(): Math.round(float) returns an int. (Math.round(double) returns a long. The other three return double.)
  • (ix) (d) 5: M0 O1 N2 O3 P4 O5 L6 Y7. The last 'O' is at index 5.
  • (x) (b) import
  • (xi) (d) Object reference variable: myTask holds the reference to the object created by new.
  • (xii) (c): A is false, because loops are nested only when one loop is inside another, not just because there are two loops. R is true.
  • (xiii) (b) 0: the condition 1 > 1 is false at the start.
  • (xiv) (a) equals()
  • (xv) (a) 9: Math.cbrt(512) = 8.0. 1/3 is integer division, which gives 0, so Math.pow(-64, 0) = 1.0. 8.0 + 1.0 = 9.0, cast to int = 9.
  • (xvi) (b): both statements are true, but R describes when default runs. It does not explain why default is optional.
  • (xvii) (c) return (x, y);: a method can return only one value.
  • (xviii) (d) Infinite loop
  • (xix) (b) Integer.parseInt()
  • (xx) (b) (2) (1) (4) (3): if a factor is found, increase c. Then increase i inside the loop, and print c after the loop.

Question 2 – Answers

(i) double m = Math.min(Math.pow(x, y), Math.pow(y, x));

(ii) c = 4. The saved value of c is 2.

Working
--c  -> c = 1, uses 1
c++  -> uses 1, then c = 2
++c  -> c = 3, uses 3
RHS  =  1 / 1 - 3 = -2
c    =  2 - (-2) = 4

(iii)

for (int i = 1; ++i <= 10; )
{
    System.out.println(i);
}

Output: 2 to 10, each on a new line.

(iv) 300: (int) 100.78 = 100, and 100 + 200 = 300.

(v) Any two: a constructor has the same name as its class. It has no return type, not even void. It is called automatically when an object is created with new. It can be overloaded.

(vi)

Output
Extreme axial tilt
Inclination Angle: 97
Volume: Medium
Inclination Angle: 25
Volume: Small

The default constructor prints a message and keeps the initial values 97 and "Medium". The parameterised constructor overwrites them with 25 and "Small".

(vii) (a) The loop runs 12 times (i = 0 to 11, because the length is 12). (b) continue skips the even indices, so only the odd indices 1, 3, 5, 7, 9 and 11 are printed:

Output
N
E
L
G
N
E

(viii)

if (x == 'T' || x == 't')
    System.out.print("Teacher");
else
    System.out.print("Student");

(ix) 1 3 5 7 9. The even values are skipped by continue. (The paper printed a<=10:a++ with a colon, which is a typing error for a semicolon.)

(x) (a) 9: the first difference is at index 2, and 'S' (83) − 'J' (74) = 9. (b) LELICATE: every 'D' is replaced by 'L'.

Question 3 – Discount

Discount.java
import java.util.Scanner;

public class Discount
{
    int cost;
    String name;
    double dc, amt;

    void input()
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter customer name: ");
        name = sc.nextLine();
        System.out.print("Enter cost of the article: ");
        cost = sc.nextInt();
    }

    void calc()
    {
        if (cost <= 5000)
            dc = 0;
        else if (cost <= 10000)
            dc = cost * 10 / 100.0;
        else if (cost <= 15000)
            dc = cost * 15 / 100.0;
        else
            dc = cost * 20 / 100.0;
        amt = cost - dc;
    }

    void display()
    {
        System.out.println("Name of the customer\tCost\tDiscount\tAmount");
        System.out.println(name + "\t\t\t" + cost + "\t" + dc + "\t\t" + amt);
    }

    public static void main(String[] args)
    {
        Discount ob = new Discount();
        ob.input();
        ob.calc();
        ob.display();
    }
}

Question 4 – Merging two words

WordMerge.java
import java.util.Scanner;

public class WordMerge
{
    static boolean isVowel(char ch)
    {
        return "AEIOU".indexOf(ch) != -1;
    }

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("First word: ");
        String w1 = sc.next().toUpperCase();
        System.out.print("Second word: ");
        String w2 = sc.next().toUpperCase();

        if (w1.length() != w2.length())
        {
            System.out.println("Both words must be of the same length.");
            return;
        }

        String result = "";
        for (int i = 0; i < w1.length(); i++)
        {
            char a = w1.charAt(i);
            char b = w2.charAt(i);
            result = result + (isVowel(a) ? '#' : a);
            result = result + (isVowel(b) ? '%' : b);
        }
        System.out.println("First word    - " + w1);
        System.out.println("Second word   - " + w2);
        System.out.println("Output string - " + result);
    }
}

Question 5 – Pattern and series

Pattern.java
public class Pattern
{
    public static void main(String[] args)
    {
        String s = "PROGRAM";
        for (int i = 0; i < s.length(); i++)
        {
            for (int j = 0; j <= i; j++)
                System.out.print(s.charAt(j));
            System.out.println();
        }
    }
}
SeriesSum.java
import java.util.Scanner;

public class SeriesSum
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter X: ");
        double x = sc.nextDouble();
        System.out.print("Enter n: ");
        int n = sc.nextInt();
        double sum = 0;
        for (int i = 1; i <= n; i++)
            sum += Math.pow(x, i);
        System.out.println("Sum = " + sum);
    }
}

Question 6 – Method overloading

Transform.java
public class Transform
{
    int transform(int n)
    {
        int sum = 0;
        while (n > 0)
        {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }

    void transform(String str, char ch, char ch1)
    {
        String res = "";
        for (int i = 0; i < str.length(); i++)
        {
            char c = str.charAt(i);
            res += (c == ch) ? ch1 : c;
        }
        System.out.println(res);
    }

    void transform(String str, char ch)
    {
        int count = 0;
        for (int i = 0; i < str.length(); i++)
            if (str.charAt(i) == ch)
                count++;
        System.out.println(count);
    }

    public static void main(String[] args)
    {
        Transform ob = new Transform();
        System.out.println(ob.transform(458));   // 17
        ob.transform("Banana", 'n', 't');        // Batata
        ob.transform("program", 'r');            // 2
    }
}

Question 7 – Special string

SpecialString.java
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 s = sc.nextLine().toUpperCase();
        int vowels = 0, consonants = 0;
        for (int i = 0; i < s.length(); i++)
        {
            char ch = s.charAt(i);
            if (Character.isLetter(ch))
            {
                if ("AEIOU".indexOf(ch) != -1)
                    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");
    }
}

Question 8 – Oddtastic number

Oddtastic.java
import java.util.Scanner;

public class Oddtastic
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a natural number: ");
        int n = sc.nextInt();
        if (n <= 0)
        {
            System.out.println("Please enter a natural number.");
            return;
        }
        int temp = n;
        boolean allOdd = true;
        while (temp > 0)
        {
            int d = temp % 10;
            if (d % 2 == 0)
            {
                allOdd = false;
                break;
            }
            temp /= 10;
        }
        if (allOdd)
            System.out.println(n + " is an Oddtastic number");
        else
            System.out.println(n + " is not an Oddtastic number");
    }
}