ICSE Class 9 Computer Applications Sample Paper 2026-27 with Answers
A complete ICSE Class 9 Computer Applications sample paper for the 2026-27 annual exam covering OOP concepts, data types, operators, the Math class, conditional statements and loops, followed by full answers with explanations and solved Java programs.

This is a complete ICSE Class 9 Computer Applications sample paper for the 2026-27 annual exam. It covers the full Class 9 syllabus: OOP concepts, values and data types, operators, input in Java, the Math library, conditional constructs, and iterative and nested loops. It uses the same two-section format as the Class 10 board paper, so it also gets you used to the board pattern early.
Attempt the paper in 2 hours, then check your answers against the full solutions at the end.

COMPUTER APPLICATIONS – SAMPLE PAPER 2026-27
Class IX | 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 (Attempt all questions)
Question 1 – Choose the correct answer [20]
(i) Which OOP principle hides the implementation details and shows only the essential features?
- (a) Inheritance
- (b) Abstraction
- (c) Polymorphism
- (d) Encapsulation
(ii) An object is an instance of a:
- (a) method
- (b) variable
- (c) class
- (d) package
(iii) Which of these is a keyword in Java?
- (a) Main
- (b) string
- (c) void
- (d) System
(iv) What is Java source code converted into by the compiler?
- (a) Machine code
- (b) Bytecode
- (c) Assembly code
- (d) HTML
(v) What is the output of Math.ceil(-3.2)?
- (a) -4.0
- (b) -3.0
- (c) -3
- (d) 3.0
(vi) What is the output of Math.max(Math.abs(-9), 7)?
- (a) 7
- (b) -9
- (c) 9
- (d) 16
(vii) Which Scanner method reads a decimal number?
- (a) nextInt()
- (b) nextDouble()
- (c) next()
- (d) nextLine()
(viii) What is the value of 15 % 4?
- (a) 3
- (b) 3.75
- (c) 4
- (d) 0
(ix) If int a = 5;, what is the value of a after the statements a++; ++a;?
- (a) 5
- (b) 6
- (c) 7
- (d) 8
(x) Which statement is used to exit from a case in a switch statement?
- (a) exit
- (b) stop
- (c) break
- (d) continue
(xi) Which loop executes at least once, even if its condition is false?
- (a) for
- (b) while
- (c) do-while
- (d) None of these
(xii) What is the value of (char)('B' + 1)?
- (a) 67
- (b) C
- (c) B1
- (d) Error
(xiii) Which data type stores a single character?
- (a) String
- (b) char
- (c) int
- (d) boolean
(xiv) What does Math.pow(2, 3) return?
- (a) 8
- (b) 8.0
- (c) 6
- (d) 9.0
(xv) What does JVM stand for?
- (a) Java Variable Method
- (b) Java Virtual Machine
- (c) Java Visual Model
- (d) Joint Virtual Machine
(xvi) A multi-line comment in Java begins with:
- (a) //
- (b) /*
- (c) #
- (d) <!--
(xvii) In for (i = 0; i < 5; i++), what is the expression i < 5 called?
- (a) Initialisation
- (b) Test condition
- (c) Update expression
- (d) Loop body
(xviii) Which operator has the highest precedence?
- (a) +
- (b) &&
- (c) *
- (d) =
(xix) What is the output of System.out.println(2 + 3 * 4);?
- (a) 20
- (b) 14
- (c) 24
- (d) 9
(xx) Which of the following is NOT a looping statement?
- (a) for
- (b) while
- (c) switch
- (d) do-while
Question 2 – Answer the following [20]
(i) What is the difference between a class and an object? [2]
(ii) Write the Java expression for: z = (a³ + b³) / (a − b) [2]
(iii) Give the output of the following code: [2]
int x = 8, y = 3;
System.out.println(x / y + " " + x % y + " " + (double) x / y);(iv) Rewrite the following using the ternary operator: [2]
if (marks >= 40)
result = "Pass";
else
result = "Fail";(v) How many times does the loop below execute, and what is printed? [2]
int i = 10;
do {
System.out.print(i + " ");
i -= 4;
} while (i > 0);(vi) Name two primitive data types used to store decimal numbers, and give their sizes. [2]
(vii) What is the difference between break and continue? [2]
(viii) Give the output of the following code: [2]
int a = 4;
int b = a++ + a-- - --a;
System.out.println(a + " " + b);(ix) What is the purpose of the default case in a switch statement? [2]
(x) Give the output of the following code: [2]
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= i; j++)
System.out.print("*");
System.out.println();
}SECTION B (Attempt any four questions)
Each program should be written using variable descriptions and mnemonic names, so that the logic of the program is clearly shown.
Question 3 [15]
Write a program to input a customer's name and the number of units of electricity consumed. Calculate and print the bill using the following tariff:
- First 100 units: ₹5 per unit
- Next 100 units (101–200): ₹7 per unit
- Above 200 units: ₹10 per unit
A meter rent of ₹50 is added to every bill.
Question 4 [15]
Write a program to input a student's percentage (0–100) and print the grade using a switch statement on percentage / 10:
- 90 and above: A+
- 80–89: A
- 70–79: B
- 60–69: C
- 40–59: D
- Below 40: Fail
Question 5 [15]
Write a program to input n and find the sum of the following series:
S = 1 + 1/2! + 1/3! + … + 1/n!
Question 6 [15]
Write a program to input a number and check whether it is a prime number. A prime number has exactly two factors: 1 and the number itself.
Question 7 [15]
Write a program to input a 3-digit number and check whether it is an Armstrong number. An Armstrong number equals the sum of the cubes of its digits. Example: 153 = 1³ + 5³ + 3³.
Question 8 [15]
Write a program to print the following pattern using nested loops:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5SOLUTIONS
Check these only after you have attempted the paper.
Solutions to Question 1
(i) (b) Abstraction. It shows only the essential features and hides the details, the way a car driver uses the steering wheel without knowing how it works.
(ii) (c) class. A class is a blueprint, and an object is a real instance of it.
(iii) (c) void. Java keywords are always lowercase. string and Main are not keywords, and System is a class name.
(iv) (b) Bytecode. The javac compiler produces bytecode (a .class file), and the JVM then runs it.
(v) (b) -3.0. ceil() returns the smallest whole number that is greater than or equal to the argument, as a double. For -3.2 this is -3.0.
(vi) (c) 9. Math.abs(-9) is 9, and Math.max(9, 7) is 9.
(vii) (b) nextDouble()
(viii) (a) 3. 15 = 4 × 3 + 3, so the remainder is 3.
(ix) (c) 7. Each statement adds 1 to a.
(x) (c) break
(xi) (c) do-while. Its condition is checked at the end, after the body has run once.
(xii) (b) C. 'B' is 66, and 66 + 1 = 67, which is 'C' after the cast.
(xiii) (b) char
(xiv) (b) 8.0. Math.pow() always returns a double.
(xv) (b) Java Virtual Machine
(xvi) (b) /* (and the comment ends with */)
(xvii) (b) Test condition
(xviii) (c) * (multiplication) has a higher precedence than +, && and =.
(xix) (b) 14. 3 × 4 = 12 is calculated first, and then 2 + 12 = 14.
(xx) (c) switch. It is a selection (decision-making) statement.
Solutions to Question 2
(i) A class is a blueprint or template that defines the data members and methods of an object. An object is a real instance of a class. It has its own values and occupies memory. Example: Car is a class, and myCar is an object of it.
(ii)
z = (Math.pow(a, 3) + Math.pow(b, 3)) / (a - b);(iii) Output: 2 2 2.6666666666666665
x / y is integer division, which gives 2. x % y is the remainder, which is 2. (double) x / y gives a decimal result.
(iv)
result = (marks >= 40) ? "Pass" : "Fail";(v) The loop executes 3 times and prints 10 6 2. The values of i are 10, 6 and 2; the next value, −2, fails the condition.
(vi) float uses 4 bytes and double uses 8 bytes.
(vii) break ends the loop (or the switch) completely, and control moves to the statement after the loop. continue skips the rest of the current iteration and goes to the next one.
(viii) Output: 3 6
a++ → uses 4, then a = 5
a-- → uses 5, then a = 4
--a → a = 3, then uses 3
b = 4 + 5 − 3 = 6, and finally a = 3(ix) The default case runs when none of the case values match the switch expression. It handles unexpected values, such as an invalid menu choice. It is optional and is usually written last.
(x) Output:
*
**
***Solution to Question 3
import java.util.Scanner;
class ElectricityBill {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter name: ");
String name = sc.nextLine();
System.out.print("Enter units consumed: ");
int units = sc.nextInt();
double bill;
if (units <= 100)
bill = units * 5;
else if (units <= 200)
bill = 100 * 5 + (units - 100) * 7;
else
bill = 100 * 5 + 100 * 7 + (units - 200) * 10;
bill = bill + 50; // meter rent
System.out.println("Name: " + name);
System.out.println("Units: " + units);
System.out.println("Total Bill: Rs. " + bill);
}
}Sample run: for 250 units, the bill is 500 + 700 + 500 + 50 = Rs. 1750.0
Solution to Question 4
import java.util.Scanner;
class Grade {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter percentage (0-100): ");
int p = sc.nextInt();
switch (p / 10) {
case 10:
case 9:
System.out.println("Grade A+");
break;
case 8:
System.out.println("Grade A");
break;
case 7:
System.out.println("Grade B");
break;
case 6:
System.out.println("Grade C");
break;
case 5:
case 4:
System.out.println("Grade D");
break;
default:
System.out.println("Fail");
}
}
}Case 10 "falls through" to case 9 because there is no break between them. This is a clean way to group cases.
Solution to Question 5
import java.util.Scanner;
class SeriesSum {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter n: ");
int n = sc.nextInt();
double sum = 0;
long fact = 1;
for (int i = 1; i <= n; i++) {
fact = fact * i; // i!
sum = sum + 1.0 / fact;
}
System.out.println("Sum = " + sum);
}
}Sample run: for n = 4, S = 1 + 0.5 + 0.1667 + 0.0417 ≈ 1.7083
Solution to Question 6
import java.util.Scanner;
class PrimeCheck {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number: ");
int n = sc.nextInt();
int count = 0;
for (int i = 1; i <= n; i++) {
if (n % i == 0)
count++;
}
if (count == 2)
System.out.println(n + " is a prime number");
else
System.out.println(n + " is not a prime number");
}
}Counting exactly 2 factors also correctly treats 1 as not prime.
Solution to Question 7
import java.util.Scanner;
class Armstrong {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter a 3-digit number: ");
int n = sc.nextInt();
int t = n, sum = 0;
while (t > 0) {
int d = t % 10;
sum = sum + d * d * d;
t = t / 10;
}
if (sum == n)
System.out.println(n + " is an Armstrong number");
else
System.out.println(n + " is not an Armstrong number");
}
}Sample run: 153 gives "153 is an Armstrong number", because 1 + 125 + 27 = 153.
Solution to Question 8
class Pattern {
public static void main(String args[]) {
for (int i = 1; i <= 5; i++) {
for (int j = 1; j <= i; j++)
System.out.print(j + " ");
System.out.println();
}
}
}Revision Checklist for Class 9

- Know the four OOP principles, with a one-line definition and an example of each.
- Memorise the sizes of all 8 primitive data types.
- Practise output questions on
++and--. They appear in almost every paper. - Learn the return types of the Math methods:
Math.pow(),Math.sqrt(),Math.ceil()andMath.floor()return double, whileMath.round()returns long when given a double. - Write at least two loop programs every day: number programs, series and patterns.
For more practice, try our ICSE Class 9 practice tests and solved programs, which follow the same syllabus.
Related Posts
Continue learning with these related articles

Wrapper Classes and Character Methods in Java for ICSE Class 10
ICSE Class 10 Computer Applications notes on wrapper classes: primitive types and their wrappers, autoboxing and unboxing, parseInt and valueOf conversions, and Character class methods like isDigit, isLetter and toUpperCase, with output questions and a solved program.

Input in Java Using the Scanner Class for ICSE Class 9 (with the nextLine Trap)
ICSE Class 9 Computer Applications notes on taking input with the Scanner class: importing java.util, nextInt, nextDouble, next and nextLine, reading a character, the nextLine skipping problem and its fix, input errors, and solved programs.

User-Defined Methods in Java for ICSE Class 10: Parameters, Return and Overloading
ICSE Class 10 Computer Applications notes on user-defined methods: method prototype and signature, formal and actual parameters, return types, call by value vs call by reference, pure and impure methods, static methods and method overloading, with programs.