Answer the following.
- (a)$a' + b' + c'$
- (b)$a' + b' + c$
- (c)$a' \cdot b' \cdot c'$
- (d)$a' \cdot b' \cdot c$
Show answer
Answer
Correct option: (d)
The ISC Computer Science 2023 Question Paper for Class 12: all 30 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.
Answer the following.
Answer
Correct option: (d)
Answer the following.
Answer
Correct option: (c)
Answer the following.
Answer
Correct option: (a)
Answer the following.
Answer
Correct option: (b)
Answer the following.
Answer
Correct option: (c)
Answer the following.
Answer
Answer the following.
Answer
| A | A' | A + A' | (A + A')' |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
Answer the following.
this in Java programming.Answer
Answer the following.
Answer
Answer the following.
Answer
Answer the following.
Answer
Answer the following.
Answer
Final answer: 1337
Answer the following.
boolean num(int x)
{ int a=1;
for (int c=x; c>0; c/=10)
a *= 10;
return (x*x%a)==x;
}Answer (a)
| c | a |
| 25 | 10 |
| 2 | 100 |
| 0 | loop ends |
Answer (b)
Answer the following.
int task(int m, int n)
{ if(m==n)
return m;
else if(m>n)
return task(m-n, n);
else
return task(m, n-m);
}Answer (a)
Answer (b)
Answer the following.
Draw: Logic gate diagram for the reduced expression
Must show: variables and their complements as inputs
Answer (a)
Groups: (8, 10, 12, 14) → AD'; (2, 3, 6, 7) → A'C; (6, 7, 14, 15) → BC
Reduced expression: F = AD' + A'C + BC
Answer (b)

Answer the following.
Draw: Logic gate diagram for the reduced expression
Must show: variables and their complements as inputs
Answer (a)
Groups: (10, 11, 14, 15) → (A' + C'); (0, 1, 4, 5) → (A + C); (0, 2, 8, 10) → (B + D)
Reduced expression: F = (A' + C')(A + C)(B + D)
Answer (b)

Answer the following.
| INPUTS | |
|---|---|
| C | Payment through a credit card |
| A | Shopping amount is above ₹10,000/- |
| E | The customer is an employee of the shopping mall |
| I | Item carries a bonus point |
Answer
| C | A | E | I | X |
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Answer the following.
Answer

Answer the following.
Answer
| A | B | A ⊙ B | (A ⊙ B)' | A ⊕ B | (A ⊙ B)' = A ⊕ B |
| 0 | 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 | 1 |
Answer the following.
Answer
| $S_1$ | $S_0$ | Y |
| 0 | 0 | $I_0$ |
| 0 | 1 | $I_1$ |
| 1 | 0 | $I_2$ |
| 1 | 1 | $I_3$ |

Answer the following.

Answer
Answer the following.
Answer
Write the program described below.
| Class name | : | NumDude |
|---|---|---|
| Data member/instance variable: | ||
| num | : | to store a positive integer number |
| Methods / Member functions: | ||
| NumDude( ) | : | default constructor to initialise the data member with legal initial value |
| void input( ) | : | to accept a positive integer number |
| int sumDigits(int x) | : | returns the sum of the digits of number ‘x’ using recursive technique |
| void isDude( ) | : | checks whether the given number is a Dudeney number by invoking the function sumDigits() and displays the result with an appropriate message |
Answer
import java.util.Scanner;
class NumDude
{
int num; // the number to be checked
// default constructor
NumDude()
{
num = 0;
}
// accepts a positive integer
void input()
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter a positive integer: ");
num = sc.nextInt();
}
// returns the sum of the digits of x using recursion
int sumDigits(int x)
{
if (x == 0)
return 0;
return (x % 10) + sumDigits(x / 10);
}
// checks whether num is a Dudeney number
void isDude()
{
int s = sumDigits(num);
if (s * s * s == num)
System.out.println(num + " is a Dudeney number");
else
System.out.println(num + " is not a Dudeney number");
}
public static void main(String args[])
{
NumDude ob = new NumDude();
ob.input();
ob.isDude();
}
}sumDigits() adds the last digit (x % 10) to the sum of the remaining digits (x / 10) until x becomes 0. isDude() cubes that sum: if the cube equals the number, the sum is its cube root, so the number is a Dudeney number.
Sample run:Enter a positive integer: 5832
5832 is a Dudeney numberWrite the program described below.
| ORIGINAL | TRANSPOSE | ||||
|---|---|---|---|---|---|
| 11 | 5 | 7 | 11 | 8 | 1 |
| 8 | 13 | 9 | 5 | 13 | 6 |
| 1 | 6 | 20 | 7 | 9 | 20 |
| Class name | : | Trans |
|---|---|---|
| Data members/instance variables: | ||
| arr[ ][ ] | : | to store integers in the matrix |
| m | : | integer to store the size of the matrix |
| Methods / Member functions: | ||
| Trans(int mm) | : | parameterised constructor to initialise the data member $m = mm$ |
| void fillarray( ) | : | to enter integer elements in the matrix |
| void transpose( ) | : | to create the transpose of the given matrix |
| void display( ) | : | displays the original matrix and the transposed matrix by invoking the method transpose() |
Answer
import java.util.Scanner;
class Trans
{
static Scanner sc = new Scanner(System.in);
int arr[][]; // the matrix
int m; // size of the matrix
// parameterised constructor
Trans(int mm)
{
m = mm;
arr = new int[m][m];
}
// accepts the elements of the matrix
void fillarray()
{
System.out.println("Enter " + (m * m) + " elements:");
for (int i = 0; i < m; i++)
for (int j = 0; j < m; j++)
arr[i][j] = sc.nextInt();
}
// transposes the matrix in place by swapping arr[i][j] and arr[j][i]
void transpose()
{
for (int i = 0; i < m; i++)
{
for (int j = i + 1; j < m; j++)
{
int t = arr[i][j];
arr[i][j] = arr[j][i];
arr[j][i] = t;
}
}
}
// prints the matrix row by row
void print()
{
for (int i = 0; i < m; i++)
{
for (int j = 0; j < m; j++)
System.out.print(arr[i][j] + "\t");
System.out.println();
}
}
// displays the original matrix, then the transposed matrix
void display()
{
System.out.println("ORIGINAL MATRIX");
print();
transpose();
System.out.println("TRANSPOSE");
print();
}
public static void main(String args[])
{
System.out.print("Enter the size of the matrix: ");
int size = sc.nextInt();
Trans ob = new Trans(size);
ob.fillarray();
ob.display();
}
}transpose() swaps each element above the main diagonal with its mirror element below it (arr[i][j] with arr[j][i]), so rows become columns. display() prints the original matrix, invokes transpose() and prints the result.
Sample run:Enter the size of the matrix: 3
Enter 9 elements:
11 5 7
8 13 9
1 6 20
ORIGINAL MATRIX
11 5 7
8 13 9
1 6 20
TRANSPOSE
11 8 1
5 13 6
7 9 20 Write the program described below.
| Class name | : | SortAlpha |
|---|---|---|
| Data members/instance variables: | ||
| sent | : | to store a sentence |
| n | : | integer to store the number of words in a sentence |
| Methods / Member functions: | ||
| SortAlpha( ) | : | default constructor to initialise data members with legal initial values |
| void acceptsent( ) | : | to accept a sentence in UPPER CASE |
| void sort(SortAlpha P) | : | sorts the words of the sentence of object P in alphabetical order and stores the sorted sentence in the current object |
| void display( ) | : | displays the original sentence along with the sorted sentence by invoking the method sort() |
Answer
import java.util.Scanner;
class SortAlpha
{
String sent; // the sentence
int n; // number of words in the sentence
// default constructor
SortAlpha()
{
sent = "";
n = 0;
}
// accepts a sentence in upper case and counts its words
void acceptsent()
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter a sentence in UPPER CASE: ");
sent = sc.nextLine().trim().toUpperCase();
n = sent.split("\\s+").length;
}
// sorts the words of P's sentence alphabetically and stores the result in this object
void sort(SortAlpha P)
{
String w[] = P.sent.split("\\s+");
int len = w.length;
// bubble sort on the words
for (int i = 0; i < len - 1; i++)
{
for (int j = 0; j < len - 1 - i; j++)
{
if (w[j].compareTo(w[j + 1]) > 0)
{
String t = w[j];
w[j] = w[j + 1];
w[j + 1] = t;
}
}
}
sent = "";
for (int i = 0; i < len; i++)
sent = sent + w[i] + " ";
sent = sent.trim();
n = len;
}
// displays the original sentence and the sorted sentence
void display()
{
SortAlpha ob = new SortAlpha();
ob.sort(this);
System.out.println("Original sentence: " + sent);
System.out.println("Sorted sentence: " + ob.sent);
}
public static void main(String args[])
{
SortAlpha obj = new SortAlpha();
obj.acceptsent();
obj.display();
}
}sort() splits the sentence of object P into words, arranges them with bubble sort using compareTo(), and joins them back into the current object's sent. display() creates a second object, calls sort(this) on it so the original sentence is kept unchanged, and prints both.
Sample run:Enter a sentence in UPPER CASE: THE SKY IS BLUE
Original sentence: THE SKY IS BLUE
Sorted sentence: BLUE IS SKY THEAnswer the following.
| Class name | : | deQueue |
|---|---|---|
| Data members/ instance variables: | ||
| Qrr[ ] | : | array to hold integer elements |
| lim | : | maximum capacity of the dequeue |
| front | : | to point the index of the front end |
| rear | : | to point the index of the rear end |
| Methods / Member functions: | ||
| deQueue(int l) | : | constructor to initialise $lim = l$, $front = 0$ and $rear = 0$ |
| void addFront(int v) | : | to add integers in the dequeue at the front end if possible, otherwise display the message “OVERFLOW FROM FRONT” |
| void addRear(int v) | : | to add integers in the dequeue at the rear end if possible, otherwise display the message “OVERFLOW FROM REAR” |
| int popFront( ) | : | removes and returns the integers from the front end of the dequeue if any, else returns -999 |
| int popRear( ) | : | removes and returns the integers from the rear end of the dequeue if any, else returns -999 |
| void show( ) | : | displays the elements of the dequeue |
Answer
class deQueue
{
int Qrr[]; // array holding the elements
int lim; // maximum capacity
int front; // front end index
int rear; // rear end index
deQueue(int l)
{
lim = l;
front = 0;
rear = 0;
Qrr = new int[lim];
}
// adds v at the front end if there is room before front
void addFront(int v)
{
if (front > 0)
{
Qrr[front] = v;
front--;
}
else
System.out.println("OVERFLOW FROM FRONT");
}
// removes and returns the element at the front end, or -999 if empty
int popFront()
{
if (front == rear)
return -999;
front++;
return Qrr[front];
}
}The elements occupy positions front + 1 to rear, so the dequeue is empty when front == rear (both start at 0, as the constructor sets). addFront() stores the value at index front and moves front one step left; when front is 0 there is no room at the front, so it reports overflow. popFront() moves front one step right and returns the element there, or -999 if the dequeue is empty. (addRear() correspondingly does rear++ then Qrr[rear] = v while rear < lim - 1.)
Tested with the other functions filled in: after addRear(10), addRear(20), addRear(30), popFront() returned 10 and then 20; addFront(15) then put 15 in front of 30; popFront() gave 15, 30 and then -999.Answer the following.
Answer
Write the program described below.
| Class name | : | Demand |
|---|---|---|
| Data members/instance variables: | ||
| pid | : | string to store the product ID |
| pname | : | string to store the product name |
| pdemand | : | integer to store the quantity demanded for the product |
| Methods / Member functions: | ||
| Demand(...) | : | parameterised constructor to assign values to the data members |
| void display( ) | : | to display the details of the product |
| Class name | : | Supply |
|---|---|---|
| Data members/instance variables: | ||
| pproduced | : | integer to store the quantity of the product produced |
| prate | : | to store the cost per unit of the product in decimal form |
| Methods / Member functions: | ||
| Supply(...) | : | parameterised constructor to assign values to the data members of both the classes |
| double calculation( ) | : | returns the difference between the amount of demand (rate $\times$ demand) and the amount produced (rate $\times$ produced) |
| void display( ) | : | to display the details of the product and the difference in amount of demand and amount of supply by invoking the method calculation() |
Answer
class Supply extends Demand
{
int pproduced; // quantity produced
double prate; // cost per unit
// parameterised constructor for both classes
Supply(String id, String name, int d, int p, double r)
{
super(id, name, d);
pproduced = p;
prate = r;
}
// difference between amount of demand and amount produced
double calculation()
{
return (prate * pdemand) - (prate * pproduced);
}
// displays all details and the difference
void display()
{
super.display();
System.out.println("Quantity produced: " + pproduced);
System.out.println("Rate per unit: " + prate);
System.out.println("Difference in amount of demand and supply: " + calculation());
}
}Supply inherits pid, pname and pdemand from Demand. Its constructor passes the first three values to the super class constructor with super(...). display() overrides the super class method: it first calls super.display() for the product details, then prints its own data and the value returned by calculation().
Tested with a small Demand class: Supply("P101", "Pen", 500, 420, 12.5) printed the product details and "Difference in amount of demand and supply: 1000.0" ($12.5 \times 500 - 12.5 \times 420 = 1000$).Answer the following.
class Node
{
double sal;
Node next;
}
Write an Algorithm OR a Method to add a node at the end of an existing linked list.
The method declaration is as follows:
void addNode(Node ptr, double ss)Answer
// adds a node with value ss at the end of the existing list that starts at ptr
void addNode(Node ptr, double ss)
{
Node temp = new Node(); // create the new node
temp.sal = ss;
temp.next = null; // it will be the last node
while (ptr.next != null) // move to the last node
ptr = ptr.next;
ptr.next = temp; // link the new node after the last node
}Algorithm:
1. Create a new node temp; set temp.sal = ss and temp.next = null.
2. Starting from ptr, move ptr = ptr.next while ptr.next is not null, so ptr reaches the last node.
3. Set ptr.next = temp.
4. End.
Tested: starting with a one-node list (1000.0), addNode(head, 2000.5) and addNode(head, 3000) gave the list 1000.0 2000.5 3000.0.Answer the following.

Answer (a)
Answer (b)
Answer (c)
The ISC Computer Science 2023 Question Paper is a board paper for Class 12: 30 questions in printed order, 70 marks in all, asked from 8 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.
| Kind | Questions | Marks printed* |
|---|---|---|
| Program | 6 | 41 |
| Case based | 5 | 19 |
| Long answer | 2 | 8 |
| Truth table | 2 | 7 |
| Short answer | 4 | 6 |
| MCQ | 5 | 5 |
| Conversion | 2 | 4 |
| One word | 2 | 2 |
| Numerical | 1 | 2 |
| Differentiate | 1 | 1 |
| Chapter | Questions | Marks printed* |
|---|---|---|
| Boolean Algebra | 12 | 28 |
| Arrays, Strings | 3 | 22 |
| Data structures | 6 | 13 |
| Objects | 1 | 10 |
| Computer Hardware | 2 | 8 |
| Inheritance, Interfaces and Polymorphism | 3 | 7 |
| Methods | 2 | 4 |
| Recursion | 1 | 3 |
* 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.
30 questions, 70 marks in all, shown in full and in printed order on this page.
By number of questions: Boolean Algebra (12), Data structures (6), Arrays, Strings (3) and Inheritance, Interfaces and Polymorphism (3).
Tap “Show answer” under a question to see its answer. The download button saves the paper as a PDF, with or without the answers.