ISC Class 12 Computer Science Evaluation II Sample Paper 2026-27 with Solutions
A full ISC Class 12 Computer Science Evaluation II theory paper for 2026-27 on Boolean algebra, K-maps, encoders, recursion, deque, linked list and binary trees, with a checked answer key, logic diagrams and solved Java programs.

This is a full ISC Class 12 Computer Science Evaluation II (theory) paper for 2026-27, followed by a complete answer key that has been checked question by question. It follows the ISC board pattern: Boolean algebra and propositional logic, K-maps, encoders and adders, recursion, data structures (deque and linked list), binary trees, and three Java class-design programs.
Attempt it in 3 hours. The solutions include every K-map grouping and logic diagram, and full programs for Section B.

COMPUTER SCIENCE – EVALUATION II (2026-27)
Class XII | Maximum Marks: 70 | Time Allowed: Three Hours
Answer all questions from Part I (compulsory) and six questions from Part II, choosing two questions from each of Sections A, B and C. While answering questions in Part I, briefly show your working and reasoning wherever required.
PART I – 20 Marks
Question 1 [10 × 1]
(i) Which Boolean law states A + B.C = (A + B).(A + C)?
- (a) Distributive
- (b) Commutative
- (c) Absorption
- (d) Associative
(ii) Assertion: A tautology is a statement that is always true, regardless of the truth values of its variables. Reason: The negation of a tautology is always a contradiction.
- (a) Both true, and R is the correct explanation of A
- (b) Both true, but R is not the correct explanation of A
- (c) A is true, but R is false
- (d) A is false, but R is true
(iii) Assertion: If A = "You are hardworking" and B = "You will achieve success in life", then the inverse of A → B is "If you are not hardworking then you will not achieve success in life". Reason: The inverse of a conditional is obtained by interchanging the antecedent and the consequent.
- (a) Both true, and R is the correct explanation of A
- (b) Both true, but R is not the correct explanation of A
- (c) A is true, but R is false
- (d) A is false, but R is true
(iv) The dual of the Boolean expression (X.Y)' + X'.Y'.0 = (X.Y)' is:
- (a) (X + Y)'.(X' + Y' + 1) = (X + Y)'
- (b) (X + Y).(X + Y + 1) = (X + Y)
- (c) (X + Y)'.(X' + Y') + 1 = (X + Y)'
- (d) (X + Y)'.(X' + Y').0 = (X + Y)'
(v) If A = 0, B = 1, C = 1, D = 1, the minterm is:
- (a) A + B' + C' + D
- (b) A.B'.C'.D
- (c) A' + B + C + D'
- (d) A'.B.C.D
(vi) The complement of the Boolean expression X.Y'.Z + X.Y + Y.Z' is:
- (a) (X + Y + Z).(X' + Y').(Y' + Z)
- (b) (X' + Y + Z').(X + Y).(Y' + Z)
- (c) (X' + Y + Z').(X' + Y').(Y' + Z)
- (d) (X + Y + Z).(X' + Y').(Y + Z')
(vii) Assertion (A): A stack is a LIFO structure. Reason (R): Any new element pushed into the stack always gets positioned at the index after the last existing element in the stack.
- (a) Both true, and R is a correct explanation of A
- (b) Both 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
(viii) How many NAND gates are required to implement an OR gate?
(ix) Define the canonical form of a Boolean expression with respect to its cardinal form.
(x) Write one property of the keyword final.
Question 2
(i) Convert the following infix expression to postfix form: (A % B – C * D / E) + F [2]
(ii) Each element of a 2-D array CAL[15][20] requires 'n' bytes of storage. If the address of CAL[6][8] is 4428 and the base address at CAL[1][1] is 4000, find the width n of each cell when the array is stored in row-major order. [2]
(iii) A method compute(int, int) is defined as follows. What is the output of compute(1, 6)? Show the working. [3]
class Find
{
String compute(int i, int N)
{
if (i == N)
return " ";
else if (i % 2 == 1)
return " " + i + (i + 1) + compute(i + 1, N);
else
return " " + i + (i - 1) + compute(i + 1, N);
}
}(iv) The following method returns true if the number is a Happy number (one whose repeated sum of the squares of its digits eventually becomes 1). Fill in ?1?, ?2? and ?3?. [3]
boolean isHappy(int n)
{
int num = n, sum = 0;
while (?1?)
{
sum = 0;
while (n > 0)
{
sum = ?2?;
n = n / 10;
}
n = sum;
}
if (?3?) return false;
else return true;
}PART II – 50 Marks
SECTION A (Answer any two questions)
Question 3
The inaugural function of a new flyover is organised by the Public Works Department. Apart from a few special invitees, entry is permitted only if:
- The person is a Class I employee of the PWD with more than 10 years of working experience, OR
- The person is an employee of any other government or authorised private organisation, and is either at the managerial level or has more than 10 years of working experience.
Inputs: A – Class I employee of PWD, B – employee of another government or authorised private organisation, C – more than 10 years of experience, D – holds a managerial post. Output: X – eligible for entry (1 = yes).
- (i) Draw the truth table and write the POS expression for X(A, B, C, D). [5]
- (ii) Reduce the expression using a 4-variable K-map, showing the groups (octets, quads and pairs). [4]
- (iii) Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs. [1]
Question 4
(i) (a) Given F(P,Q,R,S) = Σ(0, 2, 5, 7, 8, 10, 11, 13, 14, 15), reduce it using a 4-variable K-map, showing the groups. [4] (b) Draw the logic gate diagram for the reduced expression. [1]
(ii) Convert the SOP expression X.Y + Y'.Z to canonical POS. [2]
(iii) Prove that (x' + z) + [(y' + z).(x' + y)]' = 1 [3]
Question 5
(i) What is an encoder? Draw the truth table and logic circuit of an octal-to-binary encoder. [5]
(ii) Prove that (a ∧ (a → b)) → b = 1 [2]
(iii) Draw the logic circuit of a half adder and write the Boolean expressions for its sum and carry. [3]
SECTION B (Answer any two questions)
Write each program so that it clearly shows the logic, using mnemonic names and comments. Flowcharts and algorithms are not required. The programs must be written in Java.
Question 6 – Uglynum [10]
A number is an Ugly number if its prime factors include only 2, 3 and 5. For example, 6 (2 × 3), 8 (2 × 2 × 2) and 15 (3 × 5) are ugly, while 14 (2 × 7) is not. 1 is treated as an ugly number. Design a class Uglynum:
- Data member:
int num Uglynum(): constructor to initialise num = 0void readnum(): accepts the number into numboolean isugly(int n, int f): returns true if n is an ugly number, using recursion, where f is the current factorvoid display(): calls isugly() and displays an appropriate message
Also define main() to create an object and call the methods.
Question 7 – Mirror [10]
A class Mirror contains a 2-D integer array of order n × n (maximum n = 5). It generates the mirror matrix of a given matrix as shown below:

- Data members:
int mat[][],int n Mirror(int nn): parameterised constructor to initialise n = nnvoid input(): enters the elements of the arrayvoid generate(Mirror P): generates the mirror matrix of object P and stores it in the current objectvoid display(): displays the matrix
Define main() to create objects and call the methods.
Question 8 – Snowball [10]
A snowball string is a sentence whose words are in ascending order of length, with each word exactly one letter longer than the previous one. Example: "I am the Lord" (lengths 1, 2, 3, 4). Design a class Snowball:
- Data members:
String str,String w[](words),int sz(number of words) Snowball(): constructor to initialise str to nullvoid accept(): accepts the sentence. Words may be separated by a space, comma, question mark or full stopvoid transfer(): copies the words into the arrayboolean check(): returns true if the word lengths are consecutive and ascendingvoid display(): calls check() and displays an appropriate message
SECTION C (Answer any two questions)
Question 9 – DeQue [5]
A class DeQue performs operations on a double-ended queue:
- Data members:
int ele[],int cap(capacity),int front,int rear DeQue(int max): constructor to set cap = max, front = 0, rear = 0 and create the arrayvoid pushfront(int v): adds v at the front if possible, otherwise displays "full from front..overflow"void pushrear(int v): adds v at the rear if possible, otherwise displays "full from rear..overflow"int popfront()/int poprear(): remove and return the element at the front / rear, or return -999 if the deque is emptyvoid display(): displays the elements
Specify the class DeQue, giving details of the constructor, pushfront(int), poprear() and display().
Question 10 – Linked list [5]
class Node
{
int data; // value of the current node
Node next; // reference to the next node
}Write an algorithm or Java code to delete the node at the end of an existing linked list using the method void deleteEnd(Node start), where start refers to the first node.
Question 11 – Binary tree [5]
Answer the following questions using the binary tree given below:

- (a) Preorder traversal of the tree
- (b) Postorder traversal of the tree
- (c) Children of node E
- (d) Level of node C
- (e) Is it a balanced tree?
ANSWER KEY WITH SOLUTIONS
Question 1 – Answers
- (i) (a) Distributive law: this is the distribution of + over ".".
- (ii) (b): both statements are true, but R describes the negation. It does not explain why a tautology is always true.
- (iii) (c): A is true, because the inverse of A → B is ¬A → ¬B. R is false, because interchanging the antecedent and the consequent gives the converse, not the inverse.
- (iv) (a) (X + Y)'.(X' + Y' + 1) = (X + Y)': interchange + with "." and 0 with 1. The variables and complements stay unchanged.
- (v) (d) A'.B.C.D: in a minterm, a 0 variable is complemented and a 1 variable is kept as it is.
- (vi) (c) (X' + Y + Z').(X' + Y').(Y' + Z): complement each product term with De Morgan's law.
- (vii) (a): both are true. Every push places the new element on top, at the index after the last element, so the last element pushed is the first one popped. That is exactly why a stack is LIFO.
- (viii) 3 NAND gates: A + B = (A'.B')'. Two NANDs used as inverters give A' and B', and a third NAND combines them.
- (ix) A canonical expression is one in which every term contains every variable exactly once, either complemented or uncomplemented: a sum of minterms (canonical SOP) or a product of maxterms (canonical POS). The cardinal form is the short-hand notation for it, for example F = Σ(1, 3, 5) or F = Π(0, 2, 4).
- (x) A final variable can be assigned only once, so it behaves as a constant. (Also: a final method cannot be overridden, and a final class cannot be inherited.)
Question 2 – Answers
(i) **A B % C D * E / − F +**
(A % B - C * D / E) + F
A % B -> A B %
C * D -> C D *
(C*D) / E -> C D * E /
(A%B) - (...) -> A B % C D * E / -
(...) + F -> A B % C D * E / - F +(ii) Row-major order with lower bounds 1 and 20 columns: Address = B + n[(i − 1) × 20 + (j − 1)].
4428 = 4000 + n[(6 - 1) x 20 + (8 - 1)]
428 = n x 107
n = 4 bytes(iii) Output: " 12 21 34 43 56 " (with a leading and a trailing space).
compute(1,6): 1 is odd -> " " + 1 + 2 + compute(2,6) = " 12" + ...
compute(2,6): 2 is even -> " " + 2 + 1 + compute(3,6) = " 21" + ...
compute(3,6): 3 is odd -> " 34" + compute(4,6)
compute(4,6): 4 is even -> " 43" + compute(5,6)
compute(5,6): 5 is odd -> " 56" + compute(6,6)
compute(6,6): i == N -> " "
Result: " 12 21 34 43 56 "(iv) (a) ?1? n != 1 && n != 4 (b) ?2? sum + (n % 10) * (n % 10) (c) ?3? n != 1
Every unhappy number eventually enters the cycle 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4. So the loop stops when n becomes 1 (happy) or 4 (unhappy). After the loop, n != 1 means the number is not happy.
Question 3
(i) X = 1 when A.C (Class I PWD with more than 10 years) OR B.C (other organisation with more than 10 years) OR B.D (other organisation at managerial level).
A B C D | X A B C D | X
0 0 0 0 | 0 1 0 0 0 | 0
0 0 0 1 | 0 1 0 0 1 | 0
0 0 1 0 | 0 1 0 1 0 | 1
0 0 1 1 | 0 1 0 1 1 | 1
0 1 0 0 | 0 1 1 0 0 | 0
0 1 0 1 | 1 1 1 0 1 | 1
0 1 1 0 | 1 1 1 1 0 | 1
0 1 1 1 | 1 1 1 1 1 | 1POS (cardinal form): X(A,B,C,D) = Π(0, 1, 2, 3, 4, 8, 9, 12)
Canonical POS: X = (A+B+C+D)(A+B+C+D')(A+B+C'+D)(A+B+C'+D')(A+B'+C+D)(A'+B+C+D)(A'+B+C+D')(A'+B'+C+D)
(ii) Group the 0s on the K-map. Three quads cover all eight 0s:

- Quad 1 (M0, M1, M3, M2): A = 0, B = 0 → (A + B)
- Quad 2 (M0, M1, M8, M9): B = 0, C = 0 → (B + C)
- Quad 3 (M0, M4, M12, M8): C = 0, D = 0 → (C + D)
Reduced POS: X = (A + B).(B + C).(C + D). You can check this by expanding it, which gives the SOP X = AC + BC + BD.
(iii)

Question 4
(i)(a) The K-map is shown at the top of this post. Three quads cover all ten 1s:
- Quad (m10, m11, m14, m15): P = 1, R = 1 → PR
- Quad (m5, m7, m13, m15): Q = 1, S = 1 → QS
- Quad (m0, m2, m8, m10), the four corners: Q = 0, S = 0 → Q'S'
Reduced: F = PR + QS + Q'S'
(i)(b)

(ii) X.Y + Y'.Z covers the minterms XY = 110 (6), 111 (7) and Y'Z = 001 (1), 101 (5), so F = Σ(1, 5, 6, 7). The missing terms are the maxterms:
Canonical POS: F = Π(0, 2, 3, 4) = (X + Y + Z)(X + Y' + Z)(X + Y' + Z')(X' + Y + Z)
(iii)
(x' + z) + [(y' + z).(x' + y)]'
= x' + z + (y' + z)' + (x' + y)' De Morgan's law
= x' + z + y.z' + x.y' De Morgan's law
= x' + (z + y.z') + x.y'
= x' + (z + y) + x.y' z + y.z' = z + y
= (x' + x.y') + y + z
= (x' + y') + y + z x' + x.y' = x' + y'
= x' + z + (y' + y)
= x' + z + 1 = 1 Hence provedQuestion 5
(i) An encoder is a combinational circuit that converts an active signal on one of its 2ⁿ input lines into an n-bit binary code. An octal-to-binary encoder has 8 inputs (D0 to D7) and 3 outputs (Y2 Y1 Y0). Only one input is assumed to be active at a time.
Active input | Y2 Y1 Y0
D0 | 0 0 0
D1 | 0 0 1
D2 | 0 1 0
D3 | 0 1 1
D4 | 1 0 0
D5 | 1 0 1
D6 | 1 1 0
D7 | 1 1 1Y2 = D4 + D5 + D6 + D7, Y1 = D2 + D3 + D6 + D7, Y0 = D1 + D3 + D5 + D7

(ii)
(a ∧ (a → b)) → b
= (a.(a' + b)) → b a → b = a' + b
= (a.a' + a.b) → b
= (0 + a.b) → b = a.b → b
= (a.b)' + b p → q = p' + q
= a' + b' + b De Morgan's law
= a' + 1 = 1 Hence proved(iii) A half adder adds two bits. Sum S = A ⊕ B = A'B + AB' and Carry C = A.B.

Question 6 – Uglynum
import java.util.Scanner;
class Uglynum
{
int num;
Uglynum()
{
num = 0;
}
void readnum()
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number: ");
num = sc.nextInt();
}
// f takes the values 2, 3, 5; once f passes 5 the remaining n has another prime factor
boolean isugly(int n, int f)
{
if (n <= 0)
return false;
if (n == 1)
return true;
if (f > 5)
return false;
if (n % f == 0)
return isugly(n / f, f); // keep dividing by the same factor
return isugly(n, (f == 2) ? 3 : f + 2); // 2 -> 3 -> 5 -> 7 (stop)
}
void display()
{
if (isugly(num, 2))
System.out.println(num + " is an Ugly number");
else
System.out.println(num + " is not an Ugly number");
}
public static void main(String args[])
{
Uglynum ob = new Uglynum();
ob.readnum();
ob.display();
}
}Trace for 14: isugly(14, 2) → isugly(7, 2) → isugly(7, 3) → isugly(7, 5) → isugly(7, 7) → false. Trace for 15: isugly(15, 2) → isugly(15, 3) → isugly(5, 3) → isugly(5, 5) → isugly(1, 5) → true.
Question 7 – Mirror
import java.util.Scanner;
class Mirror
{
int mat[][];
int n;
Mirror(int nn)
{
n = nn;
mat = new int[n][n];
}
void input()
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter " + (n * n) + " elements:");
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
mat[i][j] = sc.nextInt();
}
void generate(Mirror P)
{
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
mat[i][j] = P.mat[i][n - 1 - j]; // reverse each row
}
void display()
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
System.out.print(mat[i][j] + "\t");
System.out.println();
}
}
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter the size of the matrix (max 5): ");
int size = sc.nextInt();
if (size < 1 || size > 5)
{
System.out.println("Invalid size");
return;
}
Mirror original = new Mirror(size);
original.input();
Mirror mirror = new Mirror(size);
mirror.generate(original);
System.out.println("Original matrix:");
original.display();
System.out.println("Mirror matrix:");
mirror.display();
}
}Question 8 – Snowball
import java.util.*;
class Snowball
{
String str;
String w[];
int sz;
Snowball()
{
str = null;
}
void accept()
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter a sentence: ");
str = sc.nextLine();
}
void transfer()
{
StringTokenizer st = new StringTokenizer(str, " ,?.");
sz = st.countTokens();
w = new String[sz];
for (int i = 0; i < sz; i++)
w[i] = st.nextToken();
}
boolean check()
{
if (sz == 0)
return false;
for (int i = 0; i < sz - 1; i++)
if (w[i + 1].length() != w[i].length() + 1)
return false;
return true;
}
void display()
{
if (check())
System.out.println("\"" + str + "\" is a Snowball string");
else
System.out.println("\"" + str + "\" is not a Snowball string");
}
public static void main(String args[])
{
Snowball ob = new Snowball();
ob.accept();
ob.transfer();
ob.display();
}
}Question 9 – DeQue
Elements are kept between the indices front and rear − 1. The deque is empty when front == rear. A new element can be added at the front only if front > 0, and at the rear only if rear < cap.
class DeQue
{
int ele[];
int cap, front, rear;
DeQue(int max)
{
cap = max;
front = 0;
rear = 0;
ele = new int[cap];
}
void pushfront(int v)
{
if (front > 0)
ele[--front] = v;
else
System.out.println("full from front..overflow");
}
void pushrear(int v)
{
if (rear < cap)
ele[rear++] = v;
else
System.out.println("full from rear..overflow");
}
int popfront()
{
if (front == rear)
return -999;
return ele[front++];
}
int poprear()
{
if (front == rear)
return -999;
return ele[--rear];
}
void display()
{
if (front == rear)
{
System.out.println("Deque is empty");
return;
}
for (int i = front; i < rear; i++)
System.out.print(ele[i] + " ");
System.out.println();
}
}The question only asks for the constructor, pushfront(), poprear() and display(). pushrear() and popfront() are included so that the class is complete.
Question 10 – Delete the last node
Algorithm
- If start is null, display "List is empty" and stop.
- If start.next is null, the list has only one node. Set start to null and stop.
- Set temp = start.
- Repeat while temp.next.next is not null: temp = temp.next. (temp now points to the second-last node.)
- Set temp.next = null. This removes the last node from the list.
- Stop.
void deleteEnd(Node start)
{
if (start == null)
{
System.out.println("List is empty");
return;
}
if (start.next == null)
{
start = null; // only node removed; the caller should also set its start to null
return;
}
Node temp = start;
while (temp.next.next != null)
temp = temp.next; // stop at the second-last node
temp.next = null; // unlink the last node
}Question 11 – Binary tree
- (a) Preorder (Root, Left, Right): A B D H I E J K C F L M G N O
- (b) Postorder (Left, Right, Root): H I D J K E B L M F N O G C A
- (c) Children of E: J and K
- (d) Level of C: 1, taking the root A as level 0. (If the root is taken as level 1, C is at level 2.)
- (e) Yes. It is a perfect (complete) binary tree, so the heights of the left and right subtrees of every node are equal.
Related Posts
Continue learning with these related articles

ISC Class 11 Computer Science Evaluation II Sample Paper 2026-27 with Solutions
A full ISC Class 11 Computer Science Evaluation II paper for 2026-27 on Boolean algebra, propositional logic, number systems, the full adder, Java class design and Python, with a checked answer key and complete solutions.

ISC Class 11 Computer Science Notes: Propositional Logic and Truth Tables
Complete ISC Class 11 Computer Science notes on propositional logic: propositions, logical connectives, truth tables, tautology, contradiction, converse, inverse and contrapositive, and the laws of logic, with solved examples.

ISC Class 12 Computer Science Sample Paper 2027 (Theory) with Solutions
A full 70-mark ISC Class 12 Computer Science theory sample paper for 2027 in the latest CISCE format: MCQs, Boolean algebra, K-maps, Java classes, recursion, inheritance, stacks, linked lists and binary trees, with complete step-by-step solutions.