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

ISC Computer Science 2024 Question Paper with Answers

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

29questions
70marks
10chapters
Q1(i)1 mark · MCQOpen: According to the Principle of duality, the Boolean equation (A + B') · (A + 1)…

Choose the correct option.

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

Answer

Correct option: (b)

Answer: (b) $(A \cdot B') + (A \cdot 0) = A \cdot B'$ Applying the Principle of Duality: interchange every $+$ with $\cdot$, and every $1$ with $0$ (variables and complements stay unchanged). $(A+B')\cdot(A+1)=A+B'$ becomes $(A\cdot B')+(A\cdot 0)=A\cdot B'$.
Q1(ii)1 mark · MCQOpen: When a sequence of OR, NOT, NOR are connected in series, the logic gate…

Choose the correct option.

When a sequence of OR, NOT, NOR are connected in series, the logic gate obtained is:
  • (a)AND
  • (b)NOT
  • (c)OR
  • (d)XOR
Show answer

Answer

Correct option: (c)

Answer: (c) OR A signal passed through OR then NOT then NOR (with both NOR inputs tied to the same signal, so the NOR acts as a NOT) is complemented twice, cancelling out. Two NOTs in a row leave the original OR output unchanged, so the overall circuit behaves as an OR gate.
Q1(iii)1 mark · MCQOpen: Idempotence Law states that:

Choose the correct option.

Idempotence Law states that:
  • (a)$X + X = X$
  • (b)$X + X' = 0$
  • (c)$X + X = 1$
  • (d)$X + X' = X$
Show answer

Answer

Correct option: (a)

Answer: (a) $X + X = X$ The Idempotence Law states that ORing (or ANDing) a variable with itself gives back the same variable.
Q1(iv)1 mark · Assertion-reasonOpen: For proposition ~ A ⇒ B, its contrapositive is B ⇒ ~ A

Study the Assertion and Reason and choose the correct option.

Assertion: For proposition $\sim A \Rightarrow B$, its contrapositive is $B \Rightarrow \sim A$

Reason: Contrapositive is the converse of inverse for any proposition.

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

Answer

Correct option: (d)

The Assertion is false: the contrapositive of $\sim A \Rightarrow B$ is $\sim B \Rightarrow A$, not $B \Rightarrow \sim A$. The Reason is true: the contrapositive of a proposition is indeed the converse of its inverse, in general. Since the Assertion is false, the Reason cannot be its explanation. Answer: (d)
Q1(v)1 mark · MCQOpen: The complement of the Boolean expression (P' · Q) + (R · S') is:

Choose the correct option.

The complement of the Boolean expression $(P' \cdot Q) + (R \cdot S')$ is:
  • (a)$(P' + Q) \cdot (R' + S)$
  • (b)$(P + Q') \cdot (R' + S)$
  • (c)$(P' + Q) \cdot (R + S')$
  • (d)$(P + Q') \cdot (R + S')$
Show answer

Answer

Correct option: (b)

Answer: (b) $(P + Q') \cdot (R' + S)$ By De Morgan's laws: $[(P' \cdot Q) + (R \cdot S')]' = (P' \cdot Q)' \cdot (R \cdot S')' = (P+Q')\cdot(R'+S)$.
Q1(vi)1 mark · Assertion-reasonOpen: Recursive data structure follows the LIFO principle.

Study the Assertion and Reason and choose the correct option.

Assertion: Recursive data structure follows the LIFO principle.

Reason: Execution of recursive code follows the concepts of data structure Queue.

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

Answer

Correct option: (c)

The Assertion is true: recursive calls are managed via the function call stack, so recursion does follow the LIFO (Last In First Out) principle. The Reason is false: execution of recursive code follows the concept of a Stack, not a Queue. Answer: (c)
Q1(vii)1 mark · Short answerOpen: State any one use of interfaces in Java.

Answer the following.

State any one use of interfaces in Java.
Show answer

Answer

Interfaces are used in Java to achieve multiple inheritance: a class can implement more than one interface, inheriting abstract behaviour from multiple sources without the ambiguity that arises from extending multiple classes.
Q1(viii)1 mark · One wordOpen: Write the cardinal form of the maxterm X + Y' + Z

Answer the following.

Write the cardinal form of the maxterm $X + Y' + Z$
Show answer

Answer

The maxterm $X+Y'+Z$ corresponds to binary code $XYZ = 010$ (an uncomplemented variable is read as 0, a complemented variable as 1), i.e. decimal 2. Cardinal form: $M_2$.
Q1(ix)1 mark · One wordOpen: Write the canonical SOP expression for F (A, B) = A ⇔ B

Answer the following.

Write the canonical SOP expression for $F (A, B) = A \Leftrightarrow B$
Show answer

Answer

$F(A,B) = A \Leftrightarrow B$ is true (1) when A and B have the same value, i.e. when $A=B=0$ or $A=B=1$. Canonical SOP: $F(A,B) = A'B' + AB$
Q1(x)1 mark · Short answerOpen: State any one difference between instance variable and class variable.

Answer the following.

State any one difference between instance variable and class variable.
Show answer

Answer

An instance variable is declared inside a class without the static keyword, and each object of the class gets its own separate copy of it. A class variable is declared with the static keyword, and only one copy of it exists, shared by all objects of the class.
Q2(i)2 marks · ConversionOpen: Convert the following infix notation to postfix form. (P + Q * R - S) / T * U

Answer the following.

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

Answer

$(P + Q * R - S) / T * U$ Using operator precedence ($*,/$ before $+,-$, left to right) and converting inside-out: Inner $(P + Q*R - S) \to P\ Q\ R\ *\ +\ S\ -$ Divide by T: $P\ Q\ R\ *\ +\ S\ -\ T\ /$ Multiply by U: Postfix: $P\ Q\ R\ *\ +\ S\ -\ T\ /\ U\ *$
Q2(ii)2 marks · NumericalOpen: An array ARR [ -5 .....15, 10.....20 ] stores elements in Row Major Wise with…

Answer the following.

An array ARR [ -5 .....15, 10.....20 ] stores elements in Row Major Wise with each element requiring 2 bytes of storage. Find the address of ARR [10] [15] when the base address is 2500.
Show answer

Answer

Rows: $-5$ to $15 \Rightarrow N = 15-(-5)+1 = 21$ Columns: $10$ to $20 \Rightarrow M = 20-10+1 = 11$ Row Major formula: $Address(ARR[i][j]) = Base + W \times [(i-L_r) \times M + (j-L_c)]$ Here $i=10, j=15, L_r=-5, L_c=10, W=2$ $= 2500 + 2 \times [(10-(-5)) \times 11 + (15-10)]$ $= 2500 + 2 \times [165+5] = 2500+340$

Final answer: 2840

Q2(iii)3 marks · Case basedOpen: int jolly(int[ ] x, int n, int m) { if (n < 0) return m; else if(n<x.length) m…

Answer the questions on the code given below.

int jolly(int[ ] x, int n, int m)
{
    if (n < 0)
        return m;
    else if(n<x.length)
        m = (x[n] > m)? x[n] : m;
    return jolly(x, --n, m);
}
The following function is a part of some class:
(a)[2]
What will be the output of jolly( ) when the value of x[ ]={6,3,4,7,1} , n=4 and m=0?
(b)[1]
What function does jolly() perform, apart from recursion?
Show answer

Answer (a)

The output is 7. Tracing jolly(x,4,0) with x={6,3,4,7,1}: m is updated at each call to the larger of the current x[n] and m, as n decreases from 4 to 0 (m becomes 1, then 7, and stays 7), then n becomes -1 and m=7 is returned. Output: 7

Answer (b)

Apart from recursion, jolly() finds and returns the maximum (largest) element present in the array x[ ].
Q2(iv)3 marks · Case basedOpen: int small_dig(int n) { int min = ?1? ; while (n != 0) { int q=n/10; int r = ?2?…

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

int small_dig(int n)
{   int min = ?1? ;
    while (n != 0)
    {
        int q=n/10;
        int r = ?2? * 10;
        min = r > min ? ?3? : r;
        n=q;
    }
    return min;
}
The following function is a part of some class which is used to find the smallest digit present in a number. There are some places in the code marked by ?1?, ?2?, ?3? which must be replaced by an expression / a statement so that the function works correctly.
(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: 9

?1? = $9$: the largest possible digit, so any digit found is smaller or equal.

Answer (b)

Blanks: n - q

?2? = $n - q$: since $n - q * 10$ gives the last digit (by operator precedence).

Answer (c)

Blanks: min

?3? = $min$: keep the current minimum when the digit is larger.
Q3(i)5 marks · Truth tableOpen: To be recruited as the Principal in a renowned College, a candidate must…

Answer the following using a truth table.

To be recruited as the Principal in a renowned College, a candidate must satisfy any one of the following criteria: • The candidate must be a Postgraduate and should either possess a B.Ed. degree or a teaching experience of more than 15 years. OR • The candidate must be an employee of the same college with a teaching experience of more than 15 years. OR • The candidate must be a Postgraduate but not an employee of the same college and should have a teaching experience of more than 15 years. The inputs are:
INPUTS
PCandidate is a Postgraduate
SCandidate is an employee of the same College
ECandidate has a teaching experience of more than 15 years
BCandidate possesses a B.Ed. degree
(In all the above cases, 1 indicates yes and 0 indicates no) Output: X - Denotes eligibility of a candidate [1 indicates eligibility and 0 indicates ineligibility in all cases] Draw the truth table for the inputs and outputs given above and write the SOP expression for X (P, S, E, B).
Show answer

Answer

PSEBX
00000
00010
00100
00110
01000
01010
01101
01111
10000
10011
10101
10111
11000
11011
11101
11111
Condition 1: P(B + E). Condition 2: S.E. Condition 3: P.S'.E. So X = P(B + E) + SE + PS'E. X(P, S, E, B) = Σ(6, 7, 9, 10, 11, 13, 14, 15) Canonical SOP: X = P'SEB' + P'SEB + PS'E'B + PS'EB' + PS'EB + PSE'B + PSEB' + PSEB
Q3(ii)5 marks · K-mapOpen: Reduce the above expression X (P, S, E, B) by using 4-variable Karnaugh map…

Reduce the following using a Karnaugh map.

Reduce the above expression X (P, S, E, B) 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: (10, 11, 14, 15) → PE; (9, 11, 13, 15) → PB; (6, 7, 14, 15) → SE

Reduced expression: X = PE + PB + SE

Three quads: (10, 11, 14, 15) gives PE, (9, 11, 13, 15) gives PB, (6, 7, 14, 15) gives SE. There is no octet. Logic gate diagram: three 2-input AND gates feeding one 3-input OR gate.
Diagram for this answer
Q4(i)5 marks · K-mapOpen: Reduce the Boolean function F(A, B, C, D) = π(0, 2, 4, 6, 8, 9, 10, 11, 14) by…

Reduce the following using a Karnaugh map.

Reduce the Boolean function $F(A, B, C, D) = \pi(0, 2, 4, 6, 8, 9, 10, 11, 14)$ 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: (8, 9, 10, 11) → (A' + B); (0, 2, 4, 6) → (A + D); (2, 6, 10, 14) → (C' + D)

Reduced expression: F = (A' + B)(A + D)(C' + D)

Quad (8, 9, 10, 11) gives (A' + B). Quad (0, 2, 4, 6) gives (A + D). Quad (2, 6, 10, 14) gives (C' + D). There is no octet. Logic gate diagram: three 2-input OR gates feeding one 3-input AND gate.
Diagram for this answer
Q4(ii)3 marks · Truth tableOpen: Verify if the following proposition is a Tautology, Contradiction or a…

Answer the following using a truth table.

Verify if the following proposition is a Tautology, Contradiction or a Contingency, using a truth table. $((A \Rightarrow B) \wedge (B \Rightarrow C)) \Rightarrow (A \Rightarrow C)$
Show answer

Answer

ABCA => BB => C(A => B).(B => C)A => C(A => B).(B => C) => (A => C)
00011111
00111111
01010011
01111111
10001001
10101011
11010001
11111111
The last column is 1 in every row, so the proposition is a Tautology.
Q4(iii)2 marks · Short answerOpen: Find the complement of the following expression and reduce it by using Boolean…

Answer the following.

Find the complement of the following expression and reduce it by using Boolean laws. $P \cdot (P + Q) \cdot Q \cdot (Q + R')$
Show answer

Answer

Let E = P.(P+Q).Q.(Q+R') By absorption law, P.(P+Q) = P, so E = P.Q.(Q+R') Again by absorption law, Q.(Q+R') = Q, so E = P.Q Complement of E: E' = (P.Q)' = P' + Q' (De Morgan's law) Verification by taking complement of the original expression directly: E' = [P.(P+Q).Q.(Q+R')]' = P' + (P+Q)' + Q' + (Q+R')' (De Morgan's law) = P' + P'.Q' + Q' + Q'.R (De Morgan's law again) = P' + Q' + Q'.R (absorption: P' + P'.Q' = P') = P' + Q' (absorption: Q' + Q'.R = Q') Reduced complement: E' = P' + Q'
Q5(i)5 marks · Long answerOpen: How is a decoder different from a multiplexer? Draw the logic circuit for 3:8…

Answer the following.

How is a decoder different from a multiplexer? Draw the logic circuit for 3:8 decoder (Octal decoder). Which multiplexer can be derived from the Octal decoder?
Show answer

Answer

Decoder vs Multiplexer: A decoder is a combinational circuit that converts n input (address) lines into a maximum of 2^n unique, mutually exclusive output lines. A multiplexer selects one out of 2^n input data lines, based on n select lines, and routes it to a single output line. 3:8 Decoder (Octal decoder): It has 3 input lines (A2, A1, A0) with their complements available, an Enable input E, and 8 output lines D0 to D7, each generated by a 4-input AND gate: D0 = E.A2'.A1'.A0' D1 = E.A2'.A1'.A0 D2 = E.A2'.A1.A0' D3 = E.A2'.A1.A0 D4 = E.A2.A1'.A0' D5 = E.A2.A1'.A0 D6 = E.A2.A1.A0' D7 = E.A2.A1.A0 An 8:1 multiplexer can be derived from the 3:8 decoder: if each decoder output Di is ANDed with a data input Ii and all eight AND outputs are fed into one 8-input OR gate, the circuit selects and outputs the data input corresponding to the 3-bit address, which is exactly an 8:1 multiplexer.
Diagram for this answer
Q5(ii)3 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 only NAND gates (three NAND gates): Step 1: NAND1 with both inputs tied to A -> output = (A.A)' = A' Step 2: NAND2 with both inputs tied to B -> output = (B.B)' = B' Step 3: NAND3 with inputs A' (from NAND1) and B' (from NAND2) -> output = (A'.B')' = A + B (De Morgan's law) So A OR B = (A NAND A) NAND (B NAND B)
Diagram for this answer
Q5(iii)2 marks · Short answerOpen: Write the canonical form of the cardinal terms, m₃ and M₅ for F (A, B, C, D).

Answer the following.

Write the canonical form of the cardinal terms, $m_3$ and $M_5$ for $F (A, B, C, D)$.
Show answer

Answer

For F(A,B,C,D) (4 variables), an uncomplemented variable in a minterm corresponds to bit 1 and a complemented variable corresponds to bit 0 (minterm index read directly as the binary value ABCD); for a maxterm the convention is reversed - an uncomplemented variable corresponds to bit 0 and a complemented variable corresponds to bit 1. $m_3$: 3 = 0011 in binary (A B C D), so A=0, B=0, C=1, D=1: $m_3 = A'B'CD$ $M_5$: 5 = 0101 in binary (A B C D), so A=0, B=1, C=0, D=1 (bit 1 -> complemented literal, bit 0 -> uncomplemented literal): $M_5 = A + B' + C + D'$
Q610 marks · ProgramOpen: Design a class DeciHex to accept a positive integer in decimal number system…

Write the program described below.

Design a class DeciHex to accept a positive integer in decimal number system from the user and display its hexadecimal equivalent. Example 1: Decimal number = 25 Hexadecimal equivalent = 19 Example 2: Decimal number = 28 Hexadecimal equivalent = 1C Some of the members of the class are given below.
Class name:DeciHex
Data members/instance variables:
num:stores the positive integer
hexa:string to store the hexadecimal equivalent of num
Methods / Member functions:
DeciHex( ):constructor to initialise the data members with legal initial values
void getNum( ):to accept a positive integer
void convert(int n):to find the hexadecimal equivalent of the formal parameter ‘n’ using the recursive technique
void display( ):to display the decimal number and its hexadecimal equivalent by invoking the function convert( )
Specify the class DeciHex giving details of the constructor( ), void getNum( ), void convert(int) and void display(). Define a main() function to create an object and call all the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class DeciHex
{
    int num;
    String hexa;

    DeciHex()
    {
        num = 0;
        hexa = "";
    }

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

    void convert(int n)
    {
        if (n == 0)
            return;
        int digit = n % 16;
        char ch;
        if (digit < 10)
            ch = (char) ('0' + digit);
        else
            ch = (char) ('A' + digit - 10);
        convert(n / 16);
        hexa = hexa + ch;
    }

    void display()
    {
        convert(num);
        if (hexa.equals(""))
            hexa = "0";
        System.out.println("Decimal number = " + num);
        System.out.println("Hexadecimal equivalent = " + hexa);
    }

    public static void main(String[] args)
    {
        DeciHex obj = new DeciHex();
        obj.getNum();
        obj.display();
    }
}
Explanation: The constructor initialises num=0 and hexa="". getNum() reads a positive integer. convert(n) is recursive: it finds the current least-significant hex digit (n%16), recurses on n/16 first (so more significant digits are processed and appended before less significant ones), then appends the current digit's hex character to hexa - this ensures the digits appear in the correct (most-significant-first) order. display() invokes convert(num) and then prints the decimal number and its hexadecimal equivalent. Tested: input 25 gives hexadecimal 19, and input 28 gives hexadecimal 1C, matching both given examples exactly.
Q710 marks · ProgramOpen: A class InsSort contains an array of integers which sorts the elements in a…

Write the program described below.

A class InsSort contains an array of integers which sorts the elements in a particular order. Some of the members of the class are given below.
Class name:InsSort
Data members/instance variables:
arr[ ]:stores the array elements
size:stores the number of elements in the array
Methods / Member functions:
InsSort(int s):constructor to initialise size = s
void getArray( ):accepts the array elements
void insertionSort( ):sorts the elements of the array in descending order using the Insertion Sort technique
double find( ):calculates and returns the average of all the odd numbers in the array
void display():displays the elements of the array in a sorted order along with the average of all the odd numbers in the array by invoking the function find( ) with an appropriate message
Specify the class InsSort giving details of the constructor( ), void getArray( ), void insertionSort( ), double find() and void display( ). Define a main() function to create an object and call all the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class InsSort
{
    int arr[];
    int size;

    InsSort(int s)
    {
        size = s;
        arr = new int[size];
    }

    void getArray()
    {
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < size; i++)
        {
            System.out.print("Enter element " + (i + 1) + ": ");
            arr[i] = sc.nextInt();
        }
    }

    void insertionSort()
    {
        for (int i = 1; i < size; i++)
        {
            int key = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] < key)
            {
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = key;
        }
    }

    double find()
    {
        int sum = 0, count = 0;
        for (int i = 0; i < size; i++)
        {
            if (arr[i] % 2 != 0)
            {
                sum += arr[i];
                count++;
            }
        }
        if (count == 0)
            return 0;
        return (double) sum / count;
    }

    void display()
    {
        System.out.print("Sorted array (descending order): ");
        for (int i = 0; i < size; i++)
            System.out.print(arr[i] + " ");
        System.out.println();
        System.out.println("Average of odd numbers = " + find());
    }

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter size of array: ");
        int s = sc.nextInt();
        InsSort obj = new InsSort(s);
        obj.getArray();
        obj.insertionSort();
        obj.display();
    }
}
Explanation: The constructor allocates arr[] of the given size. getArray() reads the elements. insertionSort() implements the standard Insertion Sort but shifts elements while the key is greater than the compared element, so the array ends up sorted in descending order. find() sums all odd-valued elements and returns their average (0 if there are none). display() prints the sorted array and calls find() to print the average of odd numbers. Tested with input {12,5,9,20,3,8}: sorted output is 20 12 9 8 5 3, and the average of the odd numbers (5,9,3) is correctly computed as 5.666666666666667.
Q810 marks · ProgramOpen: Design a class Coding to perform some string related operations on a word…

Write the program described below.

Design a class Coding to perform some string related operations on a word containing alphabets only. Example: Input: “Java” Output: Original word: Java J = 74 a = 97 v = 118 a = 97 Lowest ASCII code: 74 Highest ASCII code: 118 Some of the members of the class are given below.
Class name:Coding
Data members/instance variables:
wrd:stores the word
len:stores the length of the word
Methods / Member functions:
Coding():constructor to initialise the data members with legal initial values
void accept( ):to accept a word
void find():to display all the characters of ‘wrd’ along with their ASCII codes. Also display the lowest ASCII code and the highest ASCII code, in ‘wrd’
void show( ):to display the original word and all the characters of ‘wrd’ along with their ASCII codes. Also display the lowest ASCII code and the highest ASCII code in ‘wrd’, by invoking the function find( )
Specify the class Coding giving details of the constructor( ), void accept( ), void find( ) and void show( ). Define a main() function to create an object and call all the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class Coding
{
    String wrd;
    int len;

    Coding()
    {
        wrd = "";
        len = 0;
    }

    void accept()
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a word (alphabets only): ");
        wrd = sc.next();
        len = wrd.length();
    }

    void find()
    {
        int lowest = wrd.charAt(0);
        int highest = wrd.charAt(0);
        for (int i = 0; i < len; i++)
        {
            char ch = wrd.charAt(i);
            int code = (int) ch;
            System.out.println(ch + " = " + code);
            if (code < lowest)
                lowest = code;
            if (code > highest)
                highest = code;
        }
        System.out.println("Lowest ASCII code: " + lowest);
        System.out.println("Highest ASCII code: " + highest);
    }

    void show()
    {
        System.out.println("Original word: " + wrd);
        find();
    }

    public static void main(String[] args)
    {
        Coding obj = new Coding();
        obj.accept();
        obj.show();
    }
}
Explanation: accept() reads the word and stores its length in len. find() loops through each character of wrd, prints the character with its ASCII code, and tracks the lowest and highest ASCII codes seen; these are printed at the end. show() prints the original word and then calls find(). Tested with input "Java": output is exactly as specified - J=74, a=97, v=118, a=97, Lowest ASCII code: 74, Highest ASCII code: 118.
Q95 marks · Case basedOpen: CardGame is a game of mental skill, built on the simple premise of adding and…

Answer the questions on the class described below.

CardGame is a game of mental skill, built on the simple premise of adding and removing the cards from the top of the card pile. The details of the class CardGame are given below.
Class name:CardGame
Data members/ instance variables:
cards[ ]:array to store integers as cards
cap:to store the maximum capacity of array
top:to store the index of the topmost element of the array
Methods / Member functions:
CardGame(int cc):constructor to initialise cap=cc and top=-1
void addCard(int v):to add the card at the top index if possible, otherwise display the message “CARD PILE IS FULL”
int drawCard():to remove and return the card from the top index of the card pile, if any, else return the value -9999
void display( ):to display all the cards of card pile
(i)[4]
Specify the class CardGame giving details of the functions void addCard(int) and int drawCard(). Assume that the other functions have been defined. The main() function and algorithm need NOT be written.
(ii)[1]
Name the entity described above and state its principle.
Show answer

Answer (i)

void addCard(int v)
{
    if (top == cap - 1)
        System.out.println("CARD PILE IS FULL");
    else
    {
        top++;
        cards[top] = v;
    }
}

int drawCard()
{
    if (top == -1)
        return -9999;
    int val = cards[top];
    top--;
    return val;
}
Explanation: addCard() checks if the pile is full (top == cap-1); if not, it increments top and stores v at that index. drawCard() checks if the pile is empty (top == -1), returning -9999 in that case; otherwise it returns the value at the top index and decrements top. Tested with cap=3: after addCard(10), addCard(20), addCard(30), a further addCard(40) correctly prints 'CARD PILE IS FULL'; successive drawCard() calls correctly return 30, 20, 10 and then -9999 once empty.

Answer (ii)

The entity described is a Stack. It works on the principle of LIFO (Last In First Out) - the last card added (pushed) to the pile is the first one to be removed (popped).
Q105 marks · ProgramOpen: A super class EmpSal has been defined to store the details of an employee…

Write the program described below.

A super class EmpSal has been defined to store the details of an employee. Define a subclass Overtime to compute the total salary of the employee, after adding the overtime amount based on the following criteria. • If hours are more than 40, then ₹ 5000 are added to salary as an overtime amount • If hours are between 30 and 40 (both inclusive), then ₹ 3000 are added to salary as an overtime amount • If hours are less than 30, then the salary remains unchanged The details of the members of both the classes are given below.
Class name:EmpSal
Data members/instance variables:
empnum:to store the name of the employee
empcode:integer to store the employee code
salary:to store the salary of the employee in decimal
Methods / Member functions:
EmpSal(...):parameterised constructor to assign values to data members
void show( ):to display the details of the employee
Class name:Overtime
Data members/instance variables:
hours:integer to store overtime in hours
totsal:to store the total salary in decimal
Methods / Member functions:
Overtime(...):parameterised constructor to assign values to data members of both the classes
void calSal():calculates the total salary by adding the overtime amount to salary as per the criteria given above
void show():to display the employee details along with the total salary (salary + overtime amount)
Assume that the super class EmpSal has been defined. Using the concept of inheritance, specify the class Overtime giving the details of the constructor (...), void calSal( ) and void show( ). The super class, main function and algorithm need NOT be written.
Show answer

Answer

class Overtime extends EmpSal
{
    int hours;
    double totsal;

    Overtime(String n, int c, double s, int h)
    {
        super(n, c, s);
        hours = h;
        totsal = 0.0;
    }

    void calSal()
    {
        if (hours > 40)
            totsal = salary + 5000;
        else if (hours >= 30 && hours <= 40)
            totsal = salary + 3000;
        else
            totsal = salary;
    }

    void show()
    {
        super.show();
        calSal();
        System.out.println("Overtime Hours: " + hours);
        System.out.println("Total Salary: " + totsal);
    }
}
Explanation: Overtime extends EmpSal. Its constructor calls super(n, c, s) to initialise the inherited empnum, empcode and salary, then initialises hours and totsal. calSal() applies the three overtime criteria (hours>40 adds 5000, 30<=hours<=40 adds 3000, hours<30 leaves salary unchanged) to compute totsal. show() calls super.show() to display the inherited employee details, invokes calSal(), then prints the overtime hours and total salary. Tested with salary=40000: hours=45 gives Total Salary=45000.0, hours=35 gives 43000.0, and hours=20 gives 40000.0 (unchanged) - all matching the given criteria.
Q11(i)2 marks · Short answerOpen: With the help of an example, briefly explain the dominant term in complexity.

Answer the following.

With the help of an example, briefly explain the dominant term in complexity.
Show answer

Answer

In Big O complexity, when the number of operations of an algorithm is expressed as a sum of terms of different growth rates (e.g. $n^2 + n + 5$), the dominant term is the term that grows fastest as the input size n becomes very large - it dominates the total running time for large n, and all other (lower-order) terms and constants become insignificant in comparison and are dropped when stating the complexity. Example: For the expression $f(n) = n^2 + n + 5$, as n grows large, $n^2$ grows much faster than $n$ or the constant $5$. So $n^2$ is the dominant term, and the complexity of the algorithm is written as $O(n^2)$.
Q11(ii)3 marks · Binary treeOpen: Answer the following questions based on the diagram of a Binary Tree given…

Answer the following questions from the binary tree.

Answer the following questions based on the diagram of a Binary Tree given below:
(a)[1]
Name the external nodes of the tree.
(b)[1]
State the degree of node M and node L.
(c)[1]
Write the post-order traversal of the above tree structure.
Show answer

Answer (a)

The external nodes (leaf nodes, i.e. nodes with no children) of the tree are: F, I, C and G.

Answer (b)

Degree of node M (number of children) = 2 (children F and I). Degree of node L (number of children) = 1 (child C).

Answer (c)

Post-order traversal (Left, Right, Root) of the tree: F, I, M, E, C, L, G, H, A

About this board paper

The ISC Computer Science 2024 Question Paper is a board paper for Class 12: 29 questions in printed order, 70 marks in all, asked from 10 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*
Program435
Case based311
K-map210
Short answer58
Truth table28
Long answer15
MCQ44
Drawing13
Binary tree13
Assertion-reason22
One word22
Conversion12
Numerical12

By chapter

ChapterQuestionsMarks printed*
Boolean Algebra1228
Arrays, Strings322
Data structures411
Objects110
Computer Hardware39
Inheritance, Interfaces and Polymorphism26
Implementation of algorithms to solve problems13
Recursion13
Complexity and Big O notation12
Methods11

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

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

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

By number of questions: Boolean Algebra (12), Data structures (4), Arrays, Strings (3) and Computer Hardware (3).

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