Prashnikaप्रश्निका
Code
About
Computer ScienceImprovementClass 12

ISC Computer Science 2026 Improvement Paper with Answers

The ISC Computer Science 2026 Improvement Paper for Class 12: all 33 questions, 70 marks in all, in printed order and in full. It is free to download: tap "Show answer" under a question to see its answer, or use the download button to save the questions as a PDF, with or without answers; "Print this paper" below prints it as it was set.

33questions
70marks
9chapters
Q1(i)1 mark · MCQOpen: The Boolean equations p + p' = 1 and p · p' = 0 correspond to:

Choose the correct option.

The Boolean equations $p + p' = 1$ and $p \cdot p' = 0$ correspond to:
  • (a)Involution Law
  • (b)Absorption Law
  • (c)Commutative Law
  • (d)Complement Law
Show answer

Answer

Correct option: (d)

Answer: (d) Complement Law The laws $p+p'=1$ and $p \cdot p' = 0$ are known as the Complement Law of Boolean algebra.
Q1(ii)1 mark · MCQOpen: According to the Principle of Duality, the Boolean equation A + B' · C + A' · B…

Choose the correct option.

According to the Principle of Duality, the Boolean equation $A + B' \cdot C + A' \cdot B \cdot C' = (A' + 0) \cdot (B + 1)$ will be equivalent to:
  • (a)$(A \cdot B + C) \cdot (A' + (B + C')) = (A' \cdot 1) + (B \cdot 0)$
  • (b)$(A \cdot B') + C \cdot (A' + B + C') = (A + 1) \cdot (B' + 0)$
  • (c)$A \cdot (B' + C) \cdot (A' + B + C') = (A' \cdot 1) + (B \cdot 0)$
  • (d)$(A \cdot B' \cdot C' + A \cdot B + A' \cdot C) = (B' \cdot 1) \cdot (A \cdot 0)$
Show answer

Answer

Correct option: (c)

Answer: (c) $A \cdot (B' + C) \cdot (A' + B + C') = (A' \cdot 1) + (B \cdot 0)$ By the Principle of Duality, every $+$ is replaced by $\cdot$, every $\cdot$ by $+$, and every $0$ by $1$ (and vice versa), while the variables/complements are left unchanged. Applying this to $A + B'\cdot C + A'\cdot B\cdot C' = (A'+0)\cdot(B+1)$ gives $A\cdot(B'+C)\cdot(A'+B+C') = (A'\cdot 1)+(B\cdot 0)$, which is option (c).
Q1(iii)1 mark · Assertion-reasonOpen: Its inverse in statement form is If you do not submit your assignment on time…

Study the Assertion and Reason and choose the correct option.

Assertion: Its inverse in statement form is If you do not submit your assignment on time, then you will not get full marks for submission.

Reason: A conditional statement $P \Rightarrow Q$ can be expressed as $\sim P \vee Q$

$P$ = You submit your assignment on time $Q$ = You get full marks for submission If $P \Rightarrow Q$ then,
  • (a)Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
  • (b)Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
  • (c)Assertion is true and Reason is false.
  • (d)Both Assertion and Reason are false.
Show answer

Answer

Correct option: (b)

Answer: (b) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion. Assertion: The inverse of $P \Rightarrow Q$ is $\sim P \Rightarrow \sim Q$, i.e. 'If you do not submit your assignment on time, then you will not get full marks for submission' — this correctly states the inverse, so the Assertion is true. Reason: $P \Rightarrow Q \equiv \sim P \vee Q$ is also a true statement, but it explains how a conditional can be written as a disjunction — it does not explain why the given statement is the inverse of $P \Rightarrow Q$. Hence Reason does not correctly explain the Assertion.
Q1(iv)1 mark · MCQOpen: The complement of the Boolean expression p' · q' + c' + p' · q is:

Choose the correct option.

The complement of the Boolean expression $p' \cdot q' + c' + p' \cdot q$ is:
  • (a)$p + q \cdot c \cdot p + q'$
  • (b)$(p' + q) \cdot c \cdot (p + q')$
  • (c)$(p + q') \cdot c' \cdot (p + q')$
  • (d)$p' \cdot q + c + p \cdot q'$
Show answer

Answer

Checked answer.

Correct option: (b)

Answer: (b) By De Morgan's laws, the complement of $p' \cdot q' + c' + p' \cdot q$ is $(p' \cdot q')' \cdot (c')' \cdot (p' \cdot q)' = (p + q) \cdot c \cdot (p + q')$. Option (b) is the one with this form; it is printed in the paper as $(p' + q) \cdot c \cdot (p + q')$, where the first bracket should read $(p + q)$.
Q1(v)1 mark · MCQOpen: The worst-case complexity for following code segment is: for (int i = 0; i < p…

Choose the correct option.

The worst-case complexity for following code segment is:
for (int i = 0; i < p; i++)
{
    a += Math.sqrt(i);
}
for (int j = 0; j < q; j++)
{
    b += Math.log(j + 1);
}
  • (a)$O(1)$
  • (b)$O(p \times q)$
  • (c)$O(p^2 + q^2)$
  • (d)$O(p + q)$
Show answer

Answer

Correct option: (d)

Answer: (d) $O(p + q)$ The two for-loops are independent (sequential, not nested): the first runs $p$ times giving $O(p)$, the second runs $q$ times giving $O(q)$. Adding two independent loop complexities gives worst-case complexity $O(p) + O(q) = O(p+q)$.
Q1(vi)1 mark · Assertion-reasonOpen: In Java, a subclass can override a method of its superclass by defining a…

Study the Assertion and Reason and choose the correct option.

Assertion: In Java, a subclass can override a method of its superclass by defining a method with the same name and same signature.

Reason: If the subclass calls the overridden method without using the super keyword, the subclass’s own version of the method will get called, leading to recursion.

  • (a)Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
  • (b)Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
  • (c)Assertion is true and Reason is false.
  • (d)Both Assertion and Reason are false.
Show answer

Answer

Correct option: (b)

Answer: (b) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion. Assertion: In Java, a subclass overrides a superclass method by defining a method with the same name and same signature — this is the correct definition of method overriding, so it is true. Reason: If a subclass method calls the overridden method by its own name (without 'super'), dynamic method dispatch causes the subclass's own version to be invoked again — which can lead to (self-)recursion. This is also a true statement, but it describes a runtime consequence of overriding rather than explaining the rule/definition of overriding stated in the Assertion. Hence Reason does not explain Assertion.
Q1(vii)1 mark · MCQOpen: Consider the following code segment: class Student { static int totalStu = 0…

Choose the correct option.

Consider the following code segment:
class Student
{
    static int totalStu = 0;
    String name;
    public Student(String n)
    {
        name = n;
        totalStu++;
    }
}
Identify the valid statement(s)? I. The variable totalStu keeps count of all Student objects created II. Each object of the class gets its own copy of totalStu III. The variable totalStu can be accessed using Student.totalStu
  • (a)Only I and II
  • (b)Only I and III
  • (c)Only II and III
  • (d)Only III
Show answer

Answer

Correct option: (b)

Answer: (b) Only I and III I is true: totalStu is incremented inside the constructor every time a Student object is created, so it keeps count of all objects created. II is false: totalStu is declared static, so it is shared by all objects of the class — there is only one copy, not a separate copy per object. III is true: a static member can be accessed directly through the class name, i.e. Student.totalStu.
Q1(viii)1 mark · Assertion-reasonOpen: In Java, an abstract class is created for the purpose of inheritance.

Study the Assertion and Reason and choose the correct option.

Assertion: In Java, an abstract class is created for the purpose of inheritance.

Reason: An abstract class can be instantiated.

  • (a)Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
  • (b)Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
  • (c)Assertion is true and Reason is false.
  • (d)Both Assertion and Reason are false.
Show answer

Answer

Correct option: (c)

Answer: (c) Assertion is true and Reason is false. Assertion: An abstract class in Java is indeed created for the purpose of being extended (inherited), so that its subclasses provide concrete implementations of its abstract methods — this is true. Reason: 'An abstract class can be instantiated' is false — an abstract class can never be instantiated directly using 'new'; only its concrete (non-abstract) subclasses can be instantiated.
Q1(x)1 mark · One wordOpen: Write the reduced expression of F(A, B, C) = π(0, 1, 2, 3, 4, 5, 6, 7)

Answer the following.

Write the reduced expression of $F(A, B, C) = \pi(0, 1, 2, 3, 4, 5, 6, 7)$
Show answer

Answer

$F(A,B,C) = \pi(0,1,2,3,4,5,6,7)$ includes every one of the 8 possible maxterms for 3 variables, which means the function equals 0 for every input combination. Reduced expression: $F(A,B,C) = 0$
Q2(i)2 marks · ConversionOpen: Convert the following infix notation to prefix form. (P + Q / R) * (S + T / U)…

Answer the following.

Convert the following infix notation to prefix form. $(P + Q / R) * (S + T / U) / V$
Show answer

Answer

Infix: $(P + Q/R) * (S + T/U) / V$ Step 1: $Q/R \to /QR$, so $P+Q/R \to +P/QR$ Step 2: $T/U \to /TU$, so $S+T/U \to +S/TU$ Step 3: $(P+Q/R)*(S+T/U) \to *\ +P/QR\ +S/TU$ Step 4: Divide the whole product by $V$: $\to /\ *+P/QR+S/TU\ V$ Prefix form: $/\ *\ +\ P\ /\ Q\ R\ +\ S\ /\ T\ U\ V$
Q2(ii)2 marks · NumericalOpen: An array Arr[3 … 8, -5 … 5] is stored Row Major Wise. The address of Arr[5][-2]…

Answer the following.

An array $Arr[3 \dots 8, -5 \dots 5]$ is stored Row Major Wise. The address of $Arr[5][-2]$ is $5120$. If each element occupies $4$ bytes in the memory, find the base address of the array.
Show answer

Answer

Row Major formula: Addr(Arr[i][j]) = Base + W × [ (i - LR) × NC + (j - LC) ] LR = 3, LC = -5, UC = 5, so NC = 5 - (-5) + 1 = 11; W = 4, i = 5, j = -2. Addr(Arr[5][-2]) = Base + 4 × [ (5 - 3) × 11 + (-2 - (-5)) ] 5120 = Base + 4 × [ 22 + 3 ] 5120 = Base + 4 × 25 5120 = Base + 100 Base = 5120 - 100 = 5020

Final answer: 5020

Q2(iii)3 marks · Case basedOpen: public int justDoIt(int num) { if (num == 0) return 0; int c = justDoIt(num /…

Answer the questions on the code given below.

public int justDoIt(int num)
{
    if (num == 0)
        return 0;
    int c = justDoIt(num / 2);
    int bit = num % 2;
    System.out.print(bit);
    return c + (bit == 1 ? 1 : 0);
}
The following function justDoIt() is a part of some class. Assume num is a positive integer. Answer the questions given below along with dry run / working.
(a)[2]
What will the function justDoIt( ) return when num = 126?
(b)[1]
What is the function justDoIt( ) performing apart from recursion?
Show answer

Answer (a)

Dry run of justDoIt(126) (verified by running the code): justDoIt(126) → calls justDoIt(63); bit=126%2=0 → prints '0' justDoIt(63) → calls justDoIt(31); bit=63%2=1 → prints '1' justDoIt(31) → calls justDoIt(15); bit=31%2=1 → prints '1' justDoIt(15) → calls justDoIt(7); bit=15%2=1 → prints '1' justDoIt(7) → calls justDoIt(3); bit=7%2=1 → prints '1' justDoIt(3) → calls justDoIt(1); bit=3%2=1 → prints '1' justDoIt(1) → calls justDoIt(0); bit=1%2=1 → prints '1' justDoIt(0) → returns 0 (base case) As the calls unwind, the bits print in order: 1111110 (this is 126 written in binary), and the count c accumulates 1 for every bit equal to 1 — there are six 1's among the seven bits. Return value: 6

Answer (b)

Apart from recursion, the function displays (prints) the binary equivalent of num, one bit at a time from the most significant bit to the least significant bit, and it counts and returns the number of 1's (set bits) present in that binary representation.
Q2(iv)3 marks · Case basedOpen: boolean isNiven(int n) { int sum = 0, temp = ?1?; while (temp > 0) { sum +=…

Fill in the blanks marked ?1?, ?2? ... so that the code works.

boolean isNiven(int n)
{
    int sum = 0, temp = ?1?;
    while (temp > 0)
    {
        sum += ?2?;
        temp /= 10;
    }
    return (?3?);
}
The following function isNiven( ) is a part of some class which is used to check if a given number is a Niven number or not. There are some places in the code marked by ?1? , ?2? , ?3? which may be replaced by a statement / expression so that the function works properly. A Niven number is a number which is exactly divisible by the sum of its digits. Example: 120 = 1+2+0 = 3 and 120 is exactly divisible by 3
(1)[1]
What is the expression or statement at ?1?
(2)[1]
What is the expression or statement at ?2?
(3)[1]
What is the expression or statement at ?3?
Show answer

Answer

Blanks: $n$; $temp \% 10$; $(sum \ne 0\ \&\&\ n \% sum == 0)$

?1? = $n$ — initialise temp with n, the number whose digit sum is to be found. ?2? = $temp \% 10$ — adds the last (units) digit of temp to sum. ?3? = $(sum \ne 0\ \&\&\ n \% sum == 0)$ — true only when n is exactly divisible by the digit sum (and sum is non-zero, to avoid division by zero). (Verified by running the completed function: isNiven(120) returns true, isNiven(123) returns false.)
Q3(i)(b)3 marks · DrawingOpen: Draw the logic gate diagram for 8 : 1 multiplexer.

Answer the following.

Draw the logic gate diagram for 8 : 1 multiplexer.

Draw: Logic gate diagram for an 8 : 1 multiplexer

Must show: 8 data inputs, 3 select lines, output

Show answer

Answer

Logic gate diagram of an 8:1 multiplexer: data inputs $I_0$ to $I_7$, select lines $S_2 S_1 S_0$ (with their complements), eight 4-input AND gates (one for each select combination) and an 8-input OR gate. $Y = S_2'S_1'S_0'I_0 + S_2'S_1'S_0I_1 + S_2'S_1S_0'I_2 + S_2'S_1S_0I_3 + S_2S_1'S_0'I_4 + S_2S_1'S_0I_5 + S_2S_1S_0'I_6 + S_2S_1S_0I_7$
Diagram for this answer
Q3(i)(c)1 mark · Short answerOpen: State any one application of an encoder.

Answer the following.

State any one application of an encoder.
Show answer

Answer

Application of an encoder: used in keyboard encoders — to convert the key pressed by the user (a decimal/alphanumeric character) into its equivalent binary (e.g. ASCII) code for the computer to process. (Other valid answers: priority encoders in interrupt-handling systems, decimal-to-BCD encoders in calculators.)
Q3(ii)3 marks · Short answerOpen: The Modus Ponens states that (p ∧ (p ⇒ q)) ⇒ q. Prove this using Boolean laws.

Answer the following.

The Modus Ponens states that $(p \wedge (p \Rightarrow q)) \Rightarrow q$. Prove this using Boolean laws.
Show answer

Answer

To prove: $(p \wedge (p \Rightarrow q)) \Rightarrow q \equiv 1$ (a tautology) 1. $p \Rightarrow q = p' + q$ (Conditional/Implication law) 2. $p \wedge (p\Rightarrow q) = p\cdot(p'+q)$ (substituting step 1) 3. $= p\cdot p' + p\cdot q$ (Distributive law) 4. $= 0 + p\cdot q$ (Complement law: $p\cdot p'=0$) 5. $= p\cdot q$ (Identity law) 6. $(p\wedge(p\Rightarrow q))\Rightarrow q = (p\cdot q)\Rightarrow q = (p\cdot q)'+q$ (Conditional law, using step 5) 7. $= p'+q'+q$ (De Morgan's law) 8. $= p'+(q'+q)$ (Associative law) 9. $= p'+1$ (Complement law: $q'+q=1$) 10. $= 1$ (Null/Dominance law) Hence $(p\wedge(p\Rightarrow q))\Rightarrow q = 1$ for all values of $p,q$ — it is a tautology, which proves Modus Ponens. (Verified by truth table.)
Q3(iii)2 marks · Short answerOpen: Given F(P, Q, R) = π(0, 1, 4, 7) write its canonical form.

Answer the following.

Given $F(P, Q, R) = \pi(0, 1, 4, 7)$ write its canonical form.
Show answer

Answer

$F(P,Q,R) = \pi(0,1,4,7)$ means the maxterms are $M_0,M_1,M_4,M_7$: $M_0=(P+Q+R)$, $M_1=(P+Q+R')$, $M_4=(P'+Q+R)$, $M_7=(P'+Q'+R')$ Canonical (POS) form: $F(P,Q,R) = (P+Q+R)\cdot(P+Q+R')\cdot(P'+Q+R)\cdot(P'+Q'+R')$
Q4(i)5 marks · Truth tableOpen: An automated parking gate uses four binary sensors. The parking gate should…

Answer the following using a truth table.

An automated parking gate uses four binary sensors. The parking gate should open under any one of the following conditions: • Vehicle detected and parking slot available OR • Parking slot available and either payment confirmed or VIP access granted OR • Payment not confirmed but VIP access granted The inputs are:
INPUTS
VVehicle detected
SParking slot available
PPayment confirmed
IVIP access granted
(In all the above cases, 1 indicates YES and 0 indicates NO) Output: X - Denotes opening of the parking gate (1 = Open, 0 = Close) Draw the truth table for the inputs and outputs given above. Write the SOP expression for $X(V, S, P, I)$.
Show answer

Answer

VSPIVS + S(P + I) + P'I
00000
00011
00100
00110
01000
01011
01101
01111
10000
10011
10100
10110
11001
11011
11101
11111
Minimal SOP: $X = VS + SP + SI + P'I$ reduces to $X = VS + SP + P'I$, which is the same function. Canonical SOP: $X = \Sigma(1, 5, 6, 7, 9, 12, 13, 14, 15)$ in the order V, S, P, I.
Q4(ii)3 marks · DrawingOpen: Draw the logic gate diagram for a Full Adder. Write the Boolean expression for…

Draw the following.

Draw the logic gate diagram for a Full Adder. Write the Boolean expression for its SUM and CARRY.

Draw: Logic gate diagram for a Full Adder

Must show: SUM, CARRY

Show answer

Answer

A full adder adds three bits A, B and the carry-in C, and gives SUM and CARRY. $SUM = A'B'C + A'BC' + AB'C' + ABC = A \oplus B \oplus C$ $CARRY = AB + BC + AC$ Logic gate diagram: two XOR gates give SUM (the first adds A and B, the second adds C); three AND gates (AB, BC, AC) feed an OR gate for CARRY.
Diagram for this answer
Q4(iii)2 marks · Truth tableOpen: Draw a truth table to verify if the following proposition is a Tautology, a…

Answer the following using a truth table.

Draw a truth table to verify if the following proposition is a Tautology, a Contradiction or a Contingency. $(A \oplus B) = (A \odot B)'$
Show answer

Answer

ABA ⊕ BA ⊙ B(A ⊙ B)'(A ⊕ B) = (A ⊙ B)'
000101
011011
101011
110101
The last column is 1 in every row, so the proposition is a Tautology.
Q5(i)5 marks · K-mapOpen: Reduce the Boolean function F(A, B, C, D) = Σ(0, 1, 2, 4, 8, 9, 10, 12) by…

Reduce the following using a Karnaugh map.

Reduce the Boolean function $F(A, B, C, D) = \Sigma(0, 1, 2, 4, 8, 9, 10, 12)$ by using 4-variable Karnaugh map, showing the various groups (i.e., octal, quads and pairs). Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs.
Show answer

Answer

Groups: (0, 1, 8, 9) → B'C'; (0, 2, 8, 10) → B'D'; (0, 4, 8, 12) → C'D'

Reduced expression: F = B'C' + B'D' + C'D'

There is no octet. Three quads: (0, 1, 8, 9) gives B'C', (0, 2, 8, 10) gives B'D' and (0, 4, 8, 12) gives C'D'. Logic gate diagram: three 2-input AND gates feeding one 3-input OR gate.
Diagram for this answer
Q5(ii)3 marks · Short answerOpen: From the logic gate diagram given below, derive the Boolean expression for (1)…

Answer the following from the logic gate diagram.

From the logic gate diagram given below, derive the Boolean expression for (1), (2) and S. Reduce the derived expression.
Figure for this question
Show answer

Answer

Checked answer.
(1) $= A \oplus B = A' \cdot B + A \cdot B'$ (2) $= (A' \cdot B + A \cdot B') \cdot C$ $S = A' \cdot B \cdot C + A \cdot B' \cdot C + A \cdot B = A \cdot B + B \cdot C + C \cdot A$ (the carry of a full adder)
  1. The first gate is an XOR gate with inputs A and B: (1) $= A \oplus B = A' \cdot B + A \cdot B'$
  2. The second gate is an AND gate with inputs (1) and C: (2) $= (A' \cdot B + A \cdot B') \cdot C = A' \cdot B \cdot C + A \cdot B' \cdot C$
  3. The bottom AND gate has inputs A and B: $A \cdot B$
  4. The OR gate gives $S = A' \cdot B \cdot C + A \cdot B' \cdot C + A \cdot B$
  5. $A \cdot B = A \cdot B \cdot (C + C') = A \cdot B \cdot C + A \cdot B \cdot C'$, and a term may be repeated (Idempotent law), so $S = (A' \cdot B \cdot C + A \cdot B \cdot C) + (A \cdot B' \cdot C + A \cdot B \cdot C) + A \cdot B$
  6. $= B \cdot C \cdot (A' + A) + A \cdot C \cdot (B' + B) + A \cdot B = B \cdot C + A \cdot C + A \cdot B$ (Complement law)
  7. $S = A \cdot B + B \cdot C + C \cdot A$
Q5(iii)2 marks · DrawingOpen: Draw the logic gate diagram for 2-input OR gate using NAND gates only. Show the…

Draw the following.

Draw the logic gate diagram for 2-input OR gate using NAND gates only. Show the expression at each step.

Draw: Logic gate diagram of a 2-input OR gate using NAND gates only, with the expression at each step

Must show: NAND gates only, expression at each step

Show answer

Answer

2-input OR gate using NAND gates only (three NAND gates): Step 1: NAND1 with both inputs tied to A: $(A \cdot A)' = A'$ Step 2: NAND2 with both inputs tied to B: $(B \cdot B)' = B'$ Step 3: NAND3 with inputs $A'$ and $B'$: $(A' \cdot B')' = A + B$ (De Morgan's law)
Diagram for this answer
Q6(i)8 marks · ProgramOpen: Design a class Powerful to check if a given number is powerful or not. A…

Write the program described below.

Design a class Powerful to check if a given number is powerful or not. A Powerful number is a number which is equal to the sum of its digits, raised to the power of the digit itself. Example: $3435 = 3^3 + 4^4 + 3^3 + 5^5 = 27 + 256 + 27 + 3125 = 3435$ The details of the members of the class are given below:
Class name:Powerful
Data member/instance variable:
num:to store a positive integer
Methods/Member functions:
Powerful( ):constructor to initialise the data member with legal initial value
void input( ):to accept a positive integer
int sum(int num):to return the sum of the $\text{digit}^{\text{digit}}$ for all digits of num using recursive technique
void check( ):to check whether the given number is a powerful number by invoking the function sum( ) and display the result with an appropriate message
Specify the class Powerful giving details of the constructor( ), void input( ), int sum(int) and void check( ). Define the main( ) function to create an object and call the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class Powerful
{
    long num;

    Powerful()
    {
        num = 0;
    }

    void input()
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a positive integer: ");
        num = sc.nextLong();
    }

    int sum(int num)
    {
        if (num == 0)
            return 0;
        int digit = num % 10;
        return (int) Math.pow(digit, digit) + sum(num / 10);
    }

    void check()
    {
        int s = sum((int) num);
        if (s == num)
            System.out.println(num + " is a Powerful number.");
        else
            System.out.println(num + " is not a Powerful number.");
    }

    public static void main(String[] args)
    {
        Powerful obj = new Powerful();
        obj.input();
        obj.check();
    }
}
Explanation: input() reads the number. sum(num) recursively adds digit^digit for the last digit of num and the sum for the remaining digits (num/10), stopping when num becomes 0. check() compares this digit-power sum to the original number and prints the appropriate message. Tested (run for real): for num = 3435, sum(3435) = 3^3+4^4+3^3+5^5 = 3435, and the program correctly printed "3435 is a Powerful number."
Q6(ii)2 marks · Short answerOpen: State the role of base case and recursive case in a recursive method.

Answer the following.

State the role of base case and recursive case in a recursive method.
Show answer

Answer

Base case: The terminating condition of a recursive method — the simplest instance of the problem that is solved directly, without making any further recursive call. It stops the chain of recursive calls, preventing infinite recursion (and stack overflow), and is where the results start being returned/unwound back up the call chain. Recursive case: The part of the method where it calls itself with a smaller/simpler version of the original problem, moving the problem progressively closer to the base case with every call. Together, the recursive case breaks the problem down step by step, and the base case stops that breakdown and begins building up the final result.
Q710 marks · ProgramOpen: A class FibList is designed to extract the terms of the Fibonacci series from a…

Write the program described below.

A class FibList is designed to extract the terms of the Fibonacci series from a set of numbers. A Fibonacci series starts with terms 0 and 1. All the other terms in this series are generated by adding the previous two terms. [A Fibonacci series with 8 terms will be 0, 1, 1, 2, 3, 5, 8, 13] Example: Input array = { 1, 4, 9, 3, 10, 13, 7 } then, Output array = { 1, 3, 13 } The details of the members of the class are given below:
Class name:FibList
Data members/instance variables:
list[ ]:array to hold positive integers
size:to store the size of array
Methods/Member functions:
FibList(int s):constructor to assign size = s
void read( ):to accept the elements of the array
boolean checkFib(int n):to check and return true if n is a Fibonacci term otherwise return false.
FibList genFib(FibList fbl):to return a new object containing only Fibonacci terms from the object fbl by invoking the method checkFib( ) as per the given instructions
void display( ):to display the elements of the original array and the array holding the Fibonacci terms
Specify the class FibList giving the details of the constructor( ), void read( ), boolean checkFib(int), FibList genFib(FibList) and void display( ). Define the main( ) function to create objects and call the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class FibList
{
    int list[];
    int size;

    FibList(int s)
    {
        size = s;
        list = new int[size];
    }

    void read()
    {
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter " + size + " positive integers:");
        for (int i = 0; i < size; i++)
            list[i] = sc.nextInt();
    }

    boolean checkFib(int n)
    {
        int a = 0, b = 1;
        if (n == 0)
            return true;
        while (b < n)
        {
            int c = a + b;
            a = b;
            b = c;
        }
        return (b == n);
    }

    FibList genFib(FibList fbl)
    {
        int count = 0;
        for (int i = 0; i < fbl.size; i++)
            if (fbl.checkFib(fbl.list[i]))
                count++;

        FibList temp = new FibList(count);
        int j = 0;
        for (int i = 0; i < fbl.size; i++)
        {
            if (fbl.checkFib(fbl.list[i]))
            {
                temp.list[j] = fbl.list[i];
                j++;
            }
        }
        return temp;
    }

    void display()
    {
        for (int i = 0; i < size; i++)
            System.out.print(list[i] + " ");
        System.out.println();
    }

    public static void main(String[] args)
    {
        FibList fbl = new FibList(7);
        fbl.read();
        FibList res = fbl.genFib(fbl);
        System.out.print("Original array: ");
        fbl.display();
        System.out.print("Fibonacci terms: ");
        res.display();
    }
}
Explanation: checkFib(n) tests whether n is a Fibonacci number by generating the series until the term is >= n and comparing. genFib(fbl) first counts how many elements of fbl.list are Fibonacci terms, creates a new FibList object of exactly that size, then copies only the Fibonacci terms into it and returns it. Tested (run for real) with input {1,4,9,3,10,13,7}: output was 'Original array: 1 4 9 3 10 13 7' and 'Fibonacci terms: 1 3 13', matching the example in the question.
Q810 marks · ProgramOpen: A class Extract is defined to get the text between the first and the last…

Write the program described below.

A class Extract is defined to get the text between the first and the last occurrences of a particular word from a sentence. In case the word occurs only once or does not occur at all, then the message gets displayed as “No such substring found”. Example: Input: Sentence - It is not true that I do not like coffee Word - not Output: true that I do The details of the members of the class are given below:
Class name:Extract
Data member/instance variable:
text:to store the sentence
Methods/Member functions:
Extract( ):constructor to initialise the data member with legal initial value
void readSent( ):to accept a sentence
String extractText(String wrd):to extract and return the substring between the first and the last occurrence of wrd from text
void display( ):to display the original sentence and the substring by invoking extractText( )
Specify the class Extract giving the details of the constructor( ), void readSent( ), String extractText(String) and void display( ). Define the main( ) function to create an object and call the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class Extract
{
    String text;

    Extract()
    {
        text = "";
    }

    void readSent()
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a sentence: ");
        text = sc.nextLine();
    }

    String extractText(String wrd)
    {
        int first = text.indexOf(wrd);
        int last = text.lastIndexOf(wrd);
        if (first == -1 || first == last)
            return "No such substring found";
        int start = first + wrd.length();
        return text.substring(start, last).trim();
    }

    void display()
    {
        System.out.println("Original sentence: " + text);
        System.out.println("Substring: " + extractText("not"));
    }

    public static void main(String[] args)
    {
        Extract obj = new Extract();
        obj.readSent();
        obj.display();
    }
}
Explanation: extractText(wrd) finds the first and last occurrence of wrd in text using indexOf() and lastIndexOf(). If wrd occurs only once or not at all (first==-1 or first==last), it returns the 'No such substring found' message; otherwise it returns the trimmed substring strictly between the end of the first occurrence and the start of the last occurrence. Tested (run for real) with the sentence 'It is not true that I do not like coffee' and word 'not': output was 'Substring: true that I do', matching the example in the question.
Q95 marks · Case basedOpen: A class CustomerService is defined to resolve customer service requests in the…

Answer the questions on the class described below.

A class CustomerService is defined to resolve customer service requests in the order in which they are received. The details of the members of the class are given below:
Class name:CustomerService
Data members/instance variables:
services[ ]:array to store customer service request
size:to store the maximum capacity of the array
first:to store the index of the first customer service request
last:to store the index of the last customer service request
Methods/Member functions:
CustomerService(int s):constructor to assign size = s, first = 0 and last = 0
void add(int reqst):to insert a request at index last, if space is available, otherwise display “Request cannot be accepted at the moment”
int del( ):to remove and return the request at index first, if any, else return -9999
(i)[4]
Specify the class CustomerService giving details of the functions void add(int) and int del( ). Assume that the other functions have been defined.
(ii)[1]
Name the entity described above and state its principle.
Show answer

Answer (i)

void add(int reqst)
{
    if (last == size)
        System.out.println("Request cannot be accepted at the moment");
    else
    {
        services[last] = reqst;
        last++;
    }
}

int del()
{
    if (first == last)
        return -9999;
    else
    {
        int val = services[first];
        first++;
        return val;
    }
}
(Tested (run for real) inside a complete class with size=3: adding a 4th request correctly printed "Request cannot be accepted at the moment", and the four del() calls correctly returned 101, 102, 103, then -9999.)

Answer (ii)

Entity: Queue Principle: FIFO (First In First Out) — the request that is added (inserted) first is the first one to be removed and serviced.
Q105 marks · ProgramOpen: A superclass Course has been defined to store the basic details of a course…

Write the program described below.

A superclass Course has been defined to store the basic details of a course. Define a subclass Internship to store internship-related information and calculate total earnings. The details of both the members of the class are given below:
Class name:Course
Data members/instance variables:
title:to store the course title
duration:to store the course duration in months
Methods/Member functions:
Course(...):parameterised constructor to assign values to its data members
void show( ):to display the course details
Class name:Internship
Data members/instance variables:
company:to store company name
stipend:to store the monthly allowance
totalEarnings:to store the total earnings
Methods/Member functions:
Internship(...):parameterised constructor to assign values to data members of both the classes
void calculate( ):to calculate the total earnings as: (stipend $\times$ duration)
void show( ):to display course and internship details
Assume that the superclass Course has been defined. Using the concept of Inheritance, specify the class Internship, giving details of constructor(...), void calculate( ) and void show( ). The super class, main function and algorithm need NOT be written.
Show answer

Answer

class Internship extends Course
{
    String company;
    double stipend;
    double totalEarnings;

    Internship(String t, int d, String c, double s)
    {
        super(t, d);
        company = c;
        stipend = s;
        totalEarnings = 0.0;
    }

    void calculate()
    {
        totalEarnings = stipend * duration;
    }

    void show()
    {
        super.show();
        System.out.println("Company: " + company);
        System.out.println("Stipend: " + stipend);
        calculate();
        System.out.println("Total Earnings: " + totalEarnings);
    }
}
Explanation: Internship extends Course. Its constructor calls super(t, d) to initialise the inherited title and duration, then initialises its own data members. calculate() computes totalEarnings as stipend × duration (duration is inherited from Course). show() calls super.show() to display the course details, then displays the internship details and total earnings. Tested (run for real, with a stub Course class and main): for duration=6 and stipend=5000.0, calculate() correctly gave Total Earnings = 30000.0.
Q11(i)2 marks · ProgramOpen: A linked list is formed from the objects of the class Node. The structure of…

Write the program described below.

A linked list is formed from the objects of the class Node. The structure of the class Node is given below:
class Node
{
    char ch;
    Node next;
}
Write an Algorithm OR a Method to count and display the number of upper-case and lower-case characters. The method declaration is as follows:
void countCase(Node startptr)
Show answer

Answer

void countCase(Node startptr)
{
    int upper = 0, lower = 0;
    Node p = startptr;
    while (p != null)
    {
        if (Character.isUpperCase(p.ch))
            upper++;
        else if (Character.isLowerCase(p.ch))
            lower++;
        p = p.next;
    }
    System.out.println("Upper-case count: " + upper);
    System.out.println("Lower-case count: " + lower);
}
Explanation: A pointer p starts at startptr and traverses the linked list node by node until it reaches null (end of list). At each node, Character.isUpperCase()/isLowerCase() checks the character ch and increments the appropriate counter; the counts are displayed once the traversal is complete. Tested (run for real) on the list H-e-L-l-O: output was 'Upper-case count: 3' and 'Lower-case count: 2', which is correct (H, L, O are upper-case; e, l are lower-case).
Q11(ii)3 marks · Case basedOpen: Answer the following questions from the diagram of a Binary Tree given below…

Answer the following questions from the binary tree.

Answer the following questions from the diagram of a Binary Tree given below:
Figure for this question
(a)[1]
Write the post-order traversal of the above tree.
(b)[1]
State the leaf nodes of the above tree.
(c)[1]
State the parent of Node D and the sibling of Node E.
Show answer

Answer (a)

Post-order traversal (left, right, root): C, E, G, F, D, B, J, I, H, A

Answer (b)

Leaf nodes (nodes with no children): C, E, G, J

Answer (c)

Parent of Node D = B Sibling of Node E = F

About this improvement paper

The ISC Computer Science 2026 Improvement Paper is a improvement paper for Class 12: 33 questions in printed order, 70 marks in all, asked from 9 chapters. An improvement paper is the paper of the improvement examination, which candidates who sit a subject again to improve their marks take.

The layout of the current Computer Science paper (sections, marks, choices) is in the paper pattern guide.

By kind of question

KindQuestionsMarks printed*
Program535
Case based414
Short answer612
Drawing38
Truth table27
MCQ55
K-map15
Assertion-reason33
One word22
Conversion12
Numerical12

By chapter

ChapterQuestionsMarks printed*
Objects429
Boolean Algebra1123
Computer Hardware613
Data structures412
Inheritance, Interfaces and Polymorphism37
Recursion25
Implementation of algorithms to solve problems13
Arrays, Strings12
Complexity and Big O notation11

* Marks are those printed on each question; where a question offers an either-or choice, both options are counted, so the totals can come to more than the paper’s own total.

Common questions

How many questions are in the ISC Computer Science 2026 Improvement Paper?

33 questions, 70 marks in all, shown in full and in printed order on this page.

Which chapters does the ISC Computer Science 2026 Improvement Paper ask most about?

By number of questions: Boolean Algebra (11), Computer Hardware (6), Objects (4) and Data structures (4).

Does this page have the answers to the ISC Computer Science 2026 Improvement Paper?

Tap “Show answer” under a question to see its answer. The download button saves the paper as a PDF, with or without the answers.