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

ISC Computer Science 2025 Question Paper with Answers

The ISC Computer Science 2025 Question Paper for Class 12: all 27 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.

27questions
70marks
11chapters
Q1(i)1 mark · MCQOpen: The complement of the Boolean expression (A · B') + (B' · C) is:

Choose the correct option.

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

Answer

Correct option: (c)

Answer: (c) $(A' + B) \cdot (B + C')$ By De Morgan's law, the complement of $(A \cdot B') + (B' \cdot C)$ is $(A \cdot B')' \cdot (B' \cdot C)' = (A' + B) \cdot (B + C')$.
Q1(ii)1 mark · Assertion-reasonOpen: The expression ~ ( X ∨ Y ) is logically equivalent to (~ X ∧ ~ Y) Given below…

Study the Assertion and Reason and choose the correct option.

Assertion: The expression $\sim ( X \vee Y )$ is logically equivalent to $(\sim X \wedge \sim Y)$

Reason: The commutative property of logical operators states that the order of the operands does not change the result of a binary operation.

Given below are two statements marked, Assertion and Reason. Read the two statements carefully and choose the correct option.
  • (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: $\sim(X \vee Y) = (\sim X \wedge \sim Y)$ is true, by De Morgan's law. Reason: the commutative property (order of operands does not change the result of a binary operation) is also a true statement, but it is unrelated to De Morgan's law and does not explain why the Assertion holds.
Q1(iii)1 mark · MCQOpen: According to the Principle of Duality, the Boolean equation (1 + Y) · (X + Y) =…

Choose the correct option.

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

Answer

Correct option: (b)

Answer: (b) $(0 \cdot Y) + (X \cdot Y) = Y \cdot X'$ By the Principle of Duality, every AND ($\cdot$) is replaced by OR ($+$), every OR by AND, and every 1 by 0 (0 by 1), while variables/complements stay unchanged. Applying this to $(1+Y) \cdot (X+Y) = Y+X'$ gives $(0 \cdot Y) + (X \cdot Y) = Y \cdot X'$.
Q1(iv)1 mark · MCQOpen: The Associative Law states that:

Choose the correct option.

The Associative Law states that:
  • (a)$A \cdot B = B \cdot A$
  • (b)$A + B = B + A$
  • (c)$A \cdot (B + C) = A \cdot B + A \cdot C$
  • (d)$A + (B + C) = (A + B) + C$
Show answer

Answer

Correct option: (d)

Answer: (d) $A + (B + C) = (A + B) + C$ The Associative Law states that the grouping of operands does not affect the result when the same operator is applied repeatedly.
Q1(v)1 mark · MCQOpen: Consider the following code statement: public class Person { int age; public…

Choose the correct option.

Consider the following code statement:
public class Person
{ int age;
    public Person (int age)
    { 
        this.age = age;
    }
}
Which of the following statements are valid for the given code? I. The keyword this in the constructor refers to the current instance of the class. II. The keyword this differentiates between the instance variable age and the parameter age. III. The keyword this can be used only in constructors.
  • (a)Only I and II
  • (b)Only II and III
  • (c)Only I and III
  • (d)Only III
Show answer

Answer

Correct option: (a)

Answer: (a) Only I and II The keyword 'this' refers to the current object's instance (I is true) and is commonly used to distinguish an instance variable from a parameter of the same name (II is true). However, 'this' can be used in any instance method, not only in constructors, so III is false.
Q1(vi)1 mark · Assertion-reasonOpen: The break statement prevents fall through effect in switch case construct…

Study the Assertion and Reason and choose the correct option.

Assertion: The break statement prevents fall through effect in switch case construct.

Reason: The break statement enables unnatural exit from the loop.

Given below are two statements marked, Assertion and Reason. Read the two statements carefully and choose the correct option.
  • (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

Checked answer.

Correct option: (b)

Answer: (b) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion. Without break, execution falls through into the following cases, so break does prevent fall through in a switch (Assertion true). break also ends a loop early (Reason true). But the Reason is about loops, while the Assertion is about switch, so the Reason does not explain the Assertion.
Q1(vii)1 mark · MCQOpen: The canonical expression of F( P, Q, R) = π (2, 5, 7) is:

Choose the correct option.

The canonical expression of $F( P, Q, R) = \pi (2, 5, 7)$ is:
  • (a)$(P + Q' + R) \cdot (P' + Q + R') \cdot (P' + Q' + R')$
  • (b)$(P \cdot Q' \cdot R) + (P' \cdot Q \cdot R') + (P' \cdot Q' \cdot R')$
  • (c)$(P' + Q + R') \cdot (P + Q' + R) \cdot (P + Q + R)$
  • (d)$(P' \cdot Q \cdot R') + (P \cdot Q' \cdot R) + (P \cdot Q \cdot R)$
Show answer

Answer

Correct option: (a)

Answer: (a) $(P + Q' + R) \cdot (P' + Q + R') \cdot (P' + Q' + R')$ For $\pi(2,5,7)$: maxterm 2 (010) gives $(P+Q'+R)$, maxterm 5 (101) gives $(P'+Q+R')$, maxterm 7 (111) gives $(P'+Q'+R')$.
Q1(viii)1 mark · Assertion-reasonOpen: If it is not a Sunday, then it is not a holiday. (Q' ⇒ P') Study the given…

Study the Assertion and Reason and choose the correct option.

Assertion: If it is not a Sunday, then it is not a holiday. ($Q' \Rightarrow P'$)

Reason: Inverse is formed when antecedent and consequent are interchanged.

Study the given propositions and the statements marked, Assertion and Reason that follow it. Choose the correct option on the basis of your analysis. P – It is a holiday Q – It is a Sunday
  • (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. $Q' \Rightarrow P'$ is the contrapositive of $P \Rightarrow Q$, and a contrapositive is always logically equivalent to the original conditional, so the Assertion is a valid, true transformation. However, the Reason is false: the Inverse of a conditional is formed by negating both the antecedent and consequent ($\sim P \Rightarrow \sim Q$), not by interchanging them - interchanging antecedent and consequent gives the Converse, not the Inverse.
Q1(ix)1 mark · Short answerOpen: For the given code segment, write Big O notation for worst case complexity. for…

Answer the following.

For the given code segment, write Big O notation for worst case complexity.
for ( int i=1; i<=P; i++)
{ Statements }
for (int j=1; j<=P; ++j)
    for (int k=1; k<=Q; k++)
    { Statements }
Show answer

Answer

Two independent (non-nested) loops each running P times give $O(P)$, and a loop of P nested with a loop of Q gives $O(P \times Q)$. Adding the two, the worst-case complexity is $O(P) + O(P \times Q) = O(P \times Q)$ (the $P \times Q$ term dominates for $P, Q \ge 1$).
Q2(i)2 marks · ConversionOpen: Convert the following infix notation to postfix form. (A - B / C) + (D * E / F)…

Convert the following.

Convert the following infix notation to postfix form. $(A - B / C) + (D * E / F) * G$
Show answer

Answer

$(A - B / C) + (D * E / F) * G$ Using operator precedence ($*$, $/$ before $-$, $+$) and left-to-right evaluation: $(A - B/C) \to A\ B\ C\ /\ -$ $(D*E/F)*G \to D\ E\ *\ F\ /\ G\ *$ Combining the two with $+$: Postfix: $A\ B\ C\ /\ -\ D\ E\ *\ F\ /\ G\ *\ +$
Q2(ii)2 marks · NumericalOpen: A matrix M[-1...10, 4....13] is stored in the memory with each element…

Solve the following.

A matrix $M[-1...10, 4....13]$ is stored in the memory with each element requiring 2 bytes of storage. If the base address is 1200, find the address of $M[2][7]$ when the matrix is stored Row Major Wise.
Show answer

Answer

Row range $-1$ to $10$ $\to$ number of rows $M = 10-(-1)+1 = 12$ Column range $4$ to $13$ $\to$ number of columns $N = 13-4+1 = 10$ Each element $W = 2$ bytes; Base address $=1200$; target $M[2][7]$ Row Major formula: $Address(M[i][j]) = Base + W \times [(i - L_r) \times N + (j - L_c)]$ Here $i=2, j=7, L_r=-1, L_c=4$ $= 1200 + 2 \times [(2-(-1)) \times 10 + (7-4)]$ $= 1200 + 2 \times [30 + 3]$ $= 1200 + 66$

Final answer: 1266

Q2(iii)3 marks · Case basedOpen: The following function int solve( ) is a part of some class. Assume 'm' and 'n'…

Answer the following questions on the given code.

The following function int solve( ) is a part of some class. Assume 'm' and 'n' are positive integers. Answer the questions given below with dry run / working.
int solve(int m, int n)
{
    int k=1;
    if(m<0)
        return -k;
    else if(m==0)
        return m;
    else
        return k+(solve(m-n, n+2));
}
(a)[2]
What will the function solve( ) return if: (1) $m = 16, n = 1$ (2) $m = 9, n = 1$
(b)[1]
What is the function solve( ) performing apart from recursion?
Show answer

Answer (a)

Dry run for m=16, n=1: solve(16,1) = 1 + solve(15,3) solve(15,3) = 1 + solve(12,5) solve(12,5) = 1 + solve(7,7) solve(7,7) = 1 + solve(0,9) solve(0,9) = 0 (since m==0) Unwinding: solve(7,7)=1, solve(12,5)=2, solve(15,3)=3, solve(16,1)=4 solve(16,1) returns 4 Dry run for m=9, n=1: solve(9,1) = 1 + solve(8,3) solve(8,3) = 1 + solve(5,5) solve(5,5) = 1 + solve(0,7) solve(0,7) = 0 Unwinding: solve(5,5)=1, solve(8,3)=2, solve(9,1)=3 solve(9,1) returns 3

Answer (b)

Apart from recursion, the function counts the number of recursive calls made (i.e. how many times n, then n+2, n+4, ... can be successively subtracted from m) before m reaches exactly 0.
Q2(iv)3 marks · Case basedOpen: The following function duck( ) is a part of some class which is used to check…

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

The following function duck( ) is a part of some class which is used to check if a given number is a duck 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 number is said to be Duck if the digit zero (0) is present in it.
boolean duck(int a)
{ int f=-1;
    if(a==0)
        return true;
    for(int i=a; i!=0;?1?)
    {   int c = i%10;
        if(c==?2?)
            {f=1; break; }
    }
    return (f==?3?)? false:true;
}
(a)[1]
What is the expression or statement at ?1?
(b)[1]
What is the expression or statement at ?2?
(c)[1]
What is the expression or statement at ?3?
Show answer

Answer (a)

Blanks: i = i / 10

?1? = $i = i / 10$ (or $i /= 10$): removes the last digit so that the loop moves to the next digit.

Answer (b)

Blanks: 0

?2? = $0$: the digit $c$ is compared with zero.

Answer (c)

Blanks: -1

?3? = $-1$: if $f$ is still $-1$, no zero digit was found, so false is returned.
Q310 marks · Case basedOpen: A superhero is allowed access to a secure Avengers facility if he / she meets…

Answer the following using a truth table and a Karnaugh map.

A superhero is allowed access to a secure Avengers facility if he / she meets any of the following criteria: • The superhero has Avengers' membership and possesses a high-security clearance badge OR • The superhero does not have Avengers membership but holds a special permit issued by S.H.I.E.L.D. along with a high-security clearance badge OR • The superhero is not a recognised ally but holds a special permit issued by S.H.I.E.L.D. along with a high-security clearance badge The inputs are:
INPUTS
ASuperhero has Avengers membership.
SSuperhero holds a special permit issued by S.H.I.E.L.D.
CSuperhero possesses a high-security clearance badge
LSuperhero is a recognised ally
(In all the above cases, 1 indicates YES and 0 indicates NO) Output: X – Denotes allowed access [1 indicates YES and 0 indicates NO in all cases]
(i)[5]
Draw the truth table for the inputs and outputs given above. Write the POS expression for X (A, S, C, L).
(ii)(a)[2.5]
Reduce the above expression X (A, S, C, L) by using 4-variable Karnaugh map, showing the various groups (i.e., octal, quads and pairs).
(ii)(b)[2.5]
Draw the logic gate diagram using NOR gates only for the reduced expression. Assume that the variables and their complements are available as inputs.

Draw: logic gate diagram using NOR gates only for the reduced expression

Show answer

Answer

3(i): X = A.C + A'.S.C + L'.S.C (access allowed when: has membership AND clearance; OR lacks membership but has a SHIELD permit AND clearance; OR is not a recognised ally but has a SHIELD permit AND clearance) Truth Table:
ASCLX
00000
00010
00100
00110
01000
01010
01101
01111
10000
10010
10101
10111
11000
11010
11101
11111
POS expression (product of maxterms where X=0, in order A,S,C,L): $X(A,S,C,L) = (A+S+C+L)(A+S+C+L')(A+S+C'+L)(A+S+C'+L')(A+S'+C+L)(A+S'+C+L')(A'+S+C+L)(A'+S+C+L')(A'+S'+C+L)(A'+S'+C+L')$ 3(ii): Reducing X(A,S,C,L) using a 4-variable K-map, grouping the zeros (0s) since the circuit is to be built with NOR gates only, which naturally realise a POS (Product of Sums) expression: - Octet (8 cells): all cells where C=0 -> gives the POS factor $C$ - Quad (4 cells): the cells where A=0 and S=0 -> gives the POS factor $(A+S)$ Reduced (minimal) POS expression: $X = (A+S) \cdot C$ With NOR gates only: a NOR gate gives $(A+S)'$, and a second NOR gate with inputs $(A+S)'$ and $C'$ gives $[(A+S)' + C']' = (A+S) \cdot C$ by De Morgan's law.
Q4(i)5 marks · Case basedOpen: F(P, Q, R, S) = Σ (0,1,2,5,7,8,9,10,13,15) Reduce the Boolean function F(P, Q…

Reduce the following using a Karnaugh map.

$F(P, Q, R, S) = \Sigma (0,1,2,5,7,8,9,10,13,15)$
(a)[4]
Reduce the Boolean function $F(P, Q, R, S) = \Sigma (0,1,2,5,7,8,9,10,13,15)$ by using 4-variable Karnaugh map, showing the various groups (i.e., octal, quads and pairs).
(b)[1]
Draw the logic gate diagram using NAND gates only for the reduced expression. Assume that the variables and their complements are available as inputs.

Draw: logic gate diagram using NAND gates only for the reduced expression

Show answer

Answer (a)

Groups: (5, 7, 13, 15) → QS; (0, 1, 8, 9) → Q'R'; (0, 2, 8, 10) → Q'S'

Reduced expression: F = QS + Q'R' + Q'S'

Quad (5, 7, 13, 15) gives QS. Quad (0, 1, 8, 9) gives Q'R'. Quad (0, 2, 8, 10) gives Q'S'. There is no octet.

Answer (b)

NAND-only (NAND-NAND) implementation of $F = QS + Q'R' + Q'S'$: one 2-input NAND gate for each product term and a 3-input NAND gate combining them, since $[(QS)' \cdot (Q'R')' \cdot (Q'S')']' = QS + Q'R' + Q'S'$ by De Morgan's law.
Diagram for this answer
Q4(ii)5 marks · Case basedOpen: From the logic gate diagram given below: Derive Boolean expression for (1), (2)…

Answer the following from the logic gate diagram.

From the logic gate diagram given below:
Figure for this question
(a)[4]
Derive Boolean expression for (1), (2) and R. Reduce the derived expression.
(b)[1]
Name the logic gate that represents the reduced expression.
Show answer

Answer (a)

Checked answer.
(1) $= (A \oplus B)' = A \cdot B + A' \cdot B'$, (2) $= A + B$, $R = (A \cdot B)' = A' + B'$
  1. The first gate is an XNOR gate with inputs A and B: (1) $= (A \oplus B)' = A \cdot B + A' \cdot B'$
  2. The second gate is an OR gate with inputs A and B: (2) $= A + B$
  3. The last gate is a NAND gate with inputs (1) and (2): $R = [(A \cdot B + A' \cdot B') \cdot (A + B)]'$
  4. Expanding: $(A \cdot B + A' \cdot B') \cdot (A + B) = A \cdot B + A \cdot B \cdot B + A \cdot A' \cdot B' + A' \cdot B \cdot B'$
  5. $A \cdot A' = 0$ and $B \cdot B' = 0$ (Complement law), and $A \cdot B + A \cdot B = A \cdot B$ (Idempotent law), so the product is $A \cdot B$
  6. $R = (A \cdot B)' = A' + B'$ (De Morgan's law)

Answer (b)

Checked answer.
$R = (A \cdot B)'$, so the reduced expression represents a NAND gate.
Q5(i)5 marks · DrawingOpen: What is an encoder? Draw the logic gate diagram for an octal to binary encoder…

Draw the following.

What is an encoder? Draw the logic gate diagram for an octal to binary encoder. State one application of a decoder.

Draw: logic gate diagram for an octal to binary encoder

Show answer

Answer

An encoder is a combinational logic circuit that converts $2^n$ input lines (of which only one is active/HIGH at a time) into an n-bit binary code on its output lines - it performs the reverse operation of a decoder. Application of a decoder: Decoders are used in memory address decoding, to select one specific memory location / register out of many, from its binary address. Octal to binary encoder: 8 input lines $D_0$ to $D_7$ (only one active at a time) and 3 outputs $A_2 A_1 A_0$: $A_2 = D_4 + D_5 + D_6 + D_7$ $A_1 = D_2 + D_3 + D_6 + D_7$ $A_0 = D_1 + D_3 + D_5 + D_7$ $D_0$ (code 000) needs no connection: when it is active all three outputs stay 0.
Diagram for this answer
Q5(ii)3 marks · Truth tableOpen: By using truth table, verify if the following proposition is valid or not.

Answer the following using a truth table.

By using truth table, verify if the following proposition is valid or not.
Show answer

Answer

XY~X~X => Y(~X => Y) ∧ XX ∧ ~YX ∧ Y(X ∧ ~Y) ∨ (X ∧ Y)(~X => Y) ∧ X <=> (X ∧ ~Y) ∨ (X ∧ Y)
001000001
011100001
100111011
110110111
Both sides have the same value in every row (the last column is all 1s), so the proposition is valid.
Q5(iii)2 marks · Case basedOpen: Study the logic gate diagram given below and answer the questions that follow…

Answer the following from the logic gate diagram.

Study the logic gate diagram given below and answer the questions that follow: What will be the output of the above gate when:
Figure for this question
(a)[1]
$A = 1, B = 0$
(b)[1]
$A = 1, B = 1$
Show answer

Answer (a)

The gate is an XOR gate. Output = $A \oplus B = 1 \oplus 0 = 1$

Answer (b)

The gate is an XOR gate. Output = $A \oplus B = 1 \oplus 1 = 0$
Q610 marks · ProgramOpen: A class Perni has been defined to accept a positive integer in binary number…

Write the program described below.

A class Perni has been defined to accept a positive integer in binary number system from the user and display if it is a Pernicious number or not. [A pernicious number is a binary number that has minimum of two digits and has prime number of 1’s in it.] Examples: • 101 is a pernicious number as the number of 1’s in 101 = 2 and 2 is prime number. • 10110 is a pernicious number as the number of 1’s in 10110 = 3 and 3 is prime number. • 1111 is a NOT a pernicious number as the number of 1’s in 1111 = 4 and 4 is NOT a prime number. The details of the members of the class are given below: Class name : Perni Data member/instance variable: num : to store a binary number Methods / Member functions: Perni( ) : constructor to initialise the data member with 0 void accept( ) : to accept a binary number (containing 0’s and 1’s only) int countOne(int k) : to count and return the number of 1’s in ‘k’ using recursive technique void check( ) : to check whether the given number is a pernicious number by invoking the function countOne( ) and to display an appropriate message Specify the class Perni giving the details of the constructor( ), void accept( ), int countOne(int) and void check( ). Define a main( ) function to create an object and call the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class Perni
{
    String num;

    Perni()
    {
        num = "0";
    }

    void accept()
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a binary number: ");
        num = sc.next();
    }

    int countOne(int k)
    {
        if (k == 0)
            return 0;
        return (k % 10) + countOne(k / 10);
    }

    void check()
    {
        int k = Integer.parseInt(num);
        int count = countOne(k);
        boolean prime = (count > 1);
        for (int i = 2; i * i <= count && prime; i++)
        {
            if (count % i == 0)
                prime = false;
        }
        if (prime)
            System.out.println(num + " is a Pernicious number.");
        else
            System.out.println(num + " is NOT a Pernicious number.");
    }

    public static void main(String[] args)
    {
        Perni obj = new Perni();
        obj.accept();
        obj.check();
    }
}
Explanation: accept() reads the binary number as a String (to allow digits like 1010 to be parsed digit-wise) and converts it with Integer.parseInt so countOne() can extract digits by %10/10. countOne(k) recursively adds up the digits of k (which, since k only has 0s and 1s, gives the count of 1's). check() then tests whether that count is prime and prints the appropriate message. Tested: 101 -> Pernicious (2 ones), 10110 -> Pernicious (3 ones), 1111 -> NOT Pernicious (4 ones).
Q710 marks · ProgramOpen: Design a class Colsum to check if the sum of elements in each corresponding…

Write the program described below.

Design a class Colsum to check if the sum of elements in each corresponding column of two matrices is equal or not. Assume that the two matrices have the same dimensions. Example: Input: MATRIX A
231
756
142
MATRIX B
742
131
256
Output: Sum of corresponding columns is equal. The details of the members of the class are given below: Class name : Colsum Data members/instance variables: mat[ ][ ] : to store the integer array elements m : to store the number of rows n : to store the number of columns Member functions/methods: Colsum(int mm, int nn) : parameterised constructor to initialise the data members m = mm and n = nn void readArray( ) : to accept the elements into the array boolean check(Colsum A, Colsum B) : to check if the sum of elements in each column of the objects A and B is equal and return true otherwise, return false void print( ) : to display the array elements Specify the class Colsum giving details of the constructor(int, int), void readArray( ), boolean check(Colsum, Colsum), and void print( ). Define the main( ) function to create objects and call the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class Colsum
{
    int mat[][];
    int m, n;

    Colsum(int mm, int nn)
    {
        m = mm;
        n = nn;
        mat = new int[m][n];
    }

    void readArray()
    {
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < m; i++)
            for (int j = 0; j < n; j++)
                mat[i][j] = sc.nextInt();
    }

    boolean check(Colsum A, Colsum B)
    {
        for (int j = 0; j < A.n; j++)
        {
            int sumA = 0, sumB = 0;
            for (int i = 0; i < A.m; i++)
            {
                sumA += A.mat[i][j];
                sumB += B.mat[i][j];
            }
            if (sumA != sumB)
                return false;
        }
        return true;
    }

    void print()
    {
        for (int i = 0; i < m; i++)
        {
            for (int j = 0; j < n; j++)
                System.out.print(mat[i][j] + " ");
            System.out.println();
        }
    }

    public static void main(String[] args)
    {
        Colsum A = new Colsum(3, 3);
        A.readArray();
        Colsum B = new Colsum(3, 3);
        B.readArray();
        if (A.check(A, B))
            System.out.println("Sum of corresponding columns is equal.");
        else
            System.out.println("Sum of corresponding columns is not equal.");
    }
}
Explanation: check(A,B) sums each column of A and the corresponding column of B and compares them; it returns false as soon as any pair of column sums differ, else true after checking all columns. Tested with the example matrices from the question - output: "Sum of corresponding columns is equal." (column sums 10,12,9 match on both sides).
Q810 marks · ProgramOpen: A class Flipgram has been defined to flip the letters of the left and right…

Write the program described below.

A class Flipgram has been defined to flip the letters of the left and right halves of a non-heterogram word. If the word has odd number of characters, then the middle letter remains at its own position. A heterogram is a word where no letter appears more than once. Example 1: INPUT : BETTER OUTPUT: TERBET Example 2: INPUT : NEVER OUTPUT: ERVNE Example 3: INPUT : THAN OUTPUT: HETEROGRAM The details of the members of the class are given below: Class name : Flipgram Data member/instance variable: word : to store a word Methods/Member functions: Flipgram(String s) : parameterised constructor to assign word = s boolean ishetero( ) : to return true if word is a heterogram else return false String flip( ) : to interchange the left and right sides of a non-heterogram word and return the resultant word void display( ) : to print the flipped word for a non-heterogram word by invoking the method flip( ). An appropriate message should be printed for a heterogram word Specify the class Flipgram giving the details of the constructor(String), boolean ishetero( ), String flip( ) and void display( ). Define a main( ) function to create an object and call the functions accordingly to enable the task.
Show answer

Answer

class Flipgram
{
    String word;

    Flipgram(String s)
    {
        word = s;
    }

    boolean ishetero()
    {
        for (int i = 0; i < word.length(); i++)
        {
            for (int j = i + 1; j < word.length(); j++)
            {
                if (word.charAt(i) == word.charAt(j))
                    return false;
            }
        }
        return true;
    }

    String flip()
    {
        int len = word.length();
        int half = len / 2;
        String left = word.substring(0, half);
        String right = (len % 2 == 0) ? word.substring(half) : word.substring(half + 1);
        String mid = (len % 2 == 0) ? "" : word.substring(half, half + 1);
        return right + mid + left;
    }

    void display()
    {
        if (ishetero())
            System.out.println("HETEROGRAM");
        else
            System.out.println(flip());
    }

    public static void main(String[] args)
    {
        Flipgram f1 = new Flipgram("BETTER");
        f1.display();
        Flipgram f2 = new Flipgram("NEVER");
        f2.display();
        Flipgram f3 = new Flipgram("THAN");
        f3.display();
    }
}
Explanation: ishetero() checks every pair of characters for a repeat; if none repeats, the word is a heterogram. flip() splits the word into left and right halves (keeping the middle letter fixed for odd-length words) and returns right+mid+left. display() prints "HETEROGRAM" for a heterogram, otherwise the flipped word. Tested: BETTER -> TERBET, NEVER -> ERVNE, THAN -> HETEROGRAM (all letters distinct), matching the question's examples.
Q95 marks · Case basedOpen: A circular queue is a linear data structure that allows data insertion at the…

Answer the following on the class described.

A circular queue is a linear data structure that allows data insertion at the rear and removal from the front, with the rear end connected to the front end forming a circular arrangement. The details of the members of the class are given below: Class name : CirQueue Data members/instance variables: Q[ ] : array to hold integer values cap : maximum capacity of the circular queue front : to point the index of the front rear : to point the index of the rear Methods/Member functions: CirQueue(int n) : constructor to initialise cap = n, front = 0 and rear = 0 void push(int v) : to add integers from the rear index if possible else display the message "QUEUE IS FULL" int remove( ) : to remove and return the integer from front if any, else return -999 void print( ) : to display the elements of the circular queue in the order of front to rear
(i)[4]
Specify the class CirQueue giving the details of the functions void push(int) and int remove( ). Assume that the other functions have been defined. The main( ) function and algorithm need NOT be written.
(ii)[1]
State one application of a circular queue.
Show answer

Answer (i)

void push(int v)
{
    if ((rear + 1) % cap == front)
        System.out.println("QUEUE IS FULL");
    else
    {
        Q[rear] = v;
        rear = (rear + 1) % cap;
    }
}

int remove()
{
    if (front == rear)
        return -999;
    int val = Q[front];
    front = (front + 1) % cap;
    return val;
}
Explanation: push() adds v at the rear index and advances rear circularly (using %cap), but first checks whether the next rear position would collide with front (queue full). remove() checks for an empty queue (front==rear) and returns -999 in that case; otherwise it returns the element at front and advances front circularly. Tested and working correctly for wraparound and full/empty conditions.

Answer (ii)

A circular queue is used to implement a CPU/round-robin scheduler, where processes are cyclically given a fixed time slice on the CPU.
Q105 marks · ProgramOpen: A superclass Flight has been defined to store the details of a flight. Define a…

Write the program described below.

A superclass Flight has been defined to store the details of a flight. Define a subclass Passenger to calculate the fare for a passenger. The details of the members of both the classes are given below: Class name : Flight Data members/instance variables: flightno : to store the flight number in string dep_time : to store the departure time in string arr_time : to store the arrival time in string basefare : to store the base fare in decimal Methods/Member functions: Flight(...) : parameterised constructor to assign values to the data members void show( ) : to display the flight details Class name : Passenger Data members/instance variables: id : to store the ID of the passenger name : to store the name of the passenger tax : to store the tax to be paid in decimal tot : to store the total amount to be paid in decimal Methods/Member functions: Passenger(...) : parameterised constructor to assign values to the data members of both the classes void cal( ) : to calculate the tax as 5% of base fare and total amount (base fare + tax) void show( ) : to display the flight details along with the passenger details and total amount to be paid Assume that the super class Flight has been defined. Using the concepts of Inheritance, specify the class Passenger giving the details of constructor(...), void cal( ) and void show( ). The super class, main function and algorithm need NOT be written.
Show answer

Answer

class Passenger extends Flight
{
    int id;
    String name;
    double tax, tot;

    Passenger(String fn, String dt, String at, double bf, int i, String n)
    {
        super(fn, dt, at, bf);
        id = i;
        name = n;
        tax = 0.0;
        tot = 0.0;
    }

    void cal()
    {
        tax = 0.05 * basefare;
        tot = basefare + tax;
    }

    void show()
    {
        super.show();
        System.out.println("Passenger ID: " + id);
        System.out.println("Passenger Name: " + name);
        System.out.println("Tax: " + tax);
        System.out.println("Total Amount: " + tot);
    }
}
Explanation: Passenger extends Flight. Its constructor calls super(...) to initialise the inherited Flight data members, then sets its own. cal() computes tax as 5% of basefare (inherited from Flight) and the total as basefare+tax. show() calls super.show() to print the flight details, then prints the passenger details and total. Tested (with a stub Flight class and main) - correctly prints flight details, tax = 250.0 and total = 5250.0 for a base fare of 5000.0.
Q11(i)2 marks · ProgramOpen: A linked list is formed from the objects of the class Cell. The class structure…

Write the program described below.

A linked list is formed from the objects of the class Cell. The class structure of the Cell is given below:
class Cell
{
    char m;
    Cell right;
}
Write an Algorithm OR a Method to print the sum of the ASCII values of the lower case alphabets present in the linked list. The method declaration is as follows:
void lowercase(Cell str)
Show answer

Answer

void lowercase(Cell str)
{
    int sum = 0;
    Cell temp = str;
    while (temp != null)
    {
        if (temp.m >= 'a' && temp.m <= 'z')
            sum = sum + (int) temp.m;
        temp = temp.right;
    }
    System.out.println("Sum of ASCII values of lowercase letters = " + sum);
}
The method traverses the linked list from the given node str to the end (right==null), adds the ASCII value of every lower-case character found (checked with the range 'a' to 'z') to sum, and finally prints the total.
Q11(ii)3 marks · Case basedOpen: Answer the following questions based on the Binary Tree given below: Write the…

Answer the following questions from the binary tree.

Answer the following questions based on the Binary Tree given below:
(a)[1]
Write the in-order traversal of the right subtree.
(b)[1]
State the depth of the entire binary tree and depth of node E.
(c)[1]
Name the external nodes of the left subtree and internal nodes of the right subtree.
Show answer

Answer (a)

The right subtree is rooted at C: F (children K and L) is its left child and G (right child M) its right child; L has the left child N. In-order traversal (Left, Root, Right) of the right subtree: K, F, N, L, C, G, M

Answer (b)

Depth of the entire binary tree = 4 (longest path A, C, F, L, N has 4 edges). Depth of node E = 2 (A, B, E).

Answer (c)

External nodes of the left subtree (rooted at B): I, J, E. Internal nodes of the right subtree (rooted at C): C, F, G, L.

About this board paper

The ISC Computer Science 2025 Question Paper is a board paper for Class 12: 27 questions in printed order, 70 marks in all, asked from 11 chapters. The board paper is the exam itself: the question paper CISCE set for that year’s ISC candidates. Solve it in one sitting, in the time allowed, to see how questions are worded and how hard the real paper is.

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

By kind of question

KindQuestionsMarks printed*
Program537
Case based836
MCQ55
Drawing15
Assertion-reason33
Truth table13
Short answer22
Conversion12
Numerical12

By chapter

ChapterQuestionsMarks printed*
Boolean Algebra1130
Objects330
Data structures412
Computer Hardware27
Inheritance, Interfaces and Polymorphism15
Implementation of algorithms to solve problems13
Recursion13
Arrays, Strings12
Complexity and Big O notation11
Methods11
Statements, Scope11

* 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 2025 Question Paper?

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

Which chapters does the ISC Computer Science 2025 Question Paper ask most about?

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

Does this page have the answers to the ISC Computer Science 2025 Question 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.