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

ISC Computer Science 2020 Question Paper with Answers

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

32questions
70marks
8chapters
Q1(a)1 mark · Short answerOpen: State the properties of zero in Boolean algebra.

Answer the following in short.

State the properties of zero in Boolean algebra.
Show answer

Answer

Properties of zero (0) in Boolean algebra: 1. Identity law (OR with 0): $A + 0 = A$ 2. Null law (AND with 0): $A \cdot 0 = 0$ 3. Complement of zero: $0' = 1$, and $A \cdot A' = 0$ (a variable ANDed with its complement gives 0).
Q1(b)1 mark · Short answerOpen: Find the complement of the following Boolean expression using De Morgan’s law…

Answer the following in short.

Find the complement of the following Boolean expression using De Morgan’s law: $F(P, Q, R) = P + (Q' \cdot R)$
Show answer

Answer

$F = P + (Q' \cdot R)$ $F' = [P + (Q' \cdot R)]' = P' \cdot (Q' \cdot R)'$ (De Morgan's law) $= P' \cdot (Q'' + R') = P' \cdot (Q + R')$ (De Morgan's law, involution law) So $F' = P'(Q + R') = P'Q + P'R'$ (verified with the boolean tool).
Q1(c)1 mark · Short answerOpen: Find the dual of: (A' + 0) · (B' + 1) = A'

Answer the following in short.

Find the dual of: $(A' + 0) \cdot (B' + 1) = A'$
Show answer

Answer

To get the dual, interchange $+$ with $\cdot$ and $0$ with $1$; the variables and their complements stay unchanged. Given: $(A' + 0) \cdot (B' + 1) = A'$ Dual: $(A' \cdot 1) + (B' \cdot 0) = A'$
Q1(d)1 mark · Short answerOpen: State whether the following proposition is a tautology, contradiction or a…

Answer the following in short.

State whether the following proposition is a tautology, contradiction or a contingency: $F = (P \Rightarrow Q) \lor (Q \Rightarrow \sim P)$
Show answer

Answer

$F = (P \Rightarrow Q) \lor (Q \Rightarrow \sim P)$ $P \Rightarrow Q = P' + Q$ and $Q \Rightarrow \sim P = Q' + P'$ $F = P' + Q + Q' + P' = P' + 1 = 1$ Truth table:
PQP=>Q~PQ=>~PF
001111
011111
100011
111001
The final column is 1 for every combination of P and Q, so the proposition is a Tautology.
Q1(e)(i)0.5 marks · Short answerOpen: Name the basic gate which is represented by the diagram.

Study the diagram and answer the question.

Name the basic gate which is represented by the diagram.
Figure for this question
Show the figure
Logic diagram: inputs A and B go to an OR-shaped gate with a bubble at its output (NOR); its output is joined to both inputs of a second NOR-shaped gate, whose output is X.
Show answer

Answer

The diagram is an OR gate. The first gate is a NOR gate; the second NOR gate has both its inputs joined, so it works as a NOT gate. NOR followed by NOT gives OR: $X = \overline{\overline{A+B}} = A + B$.
Q1(e)(ii)0.5 marks · Short answerOpen: What will be the value of X when A=1 and B=0 ?

Study the diagram and answer the question.

What will be the value of X when A=1 and B=0 ?
Figure for this question
Show answer

Answer

$X = A + B = 1 + 0 = 1$. (First gate: NOR(1,0) = 0; second gate: NOR(0,0) = 1.) So X = 1.
Q2(a)2 marks · DifferentiateOpen: State the difference between a Binary Tree structure and a single Linked List.

Differentiate between the following.

State the difference between a Binary Tree structure and a single Linked List.
Show answer

Answer

Binary tree: a non-linear, hierarchical data structure with a root; every node can have up to two children (left and right), so each node holds two links. Data is reached by moving down from the root through a path, and in a binary search tree searching is fast (about $O(\log n)$ for a balanced tree). Single linked list: a linear data structure; each node holds one link (next) to the following node, so the nodes form a single chain from the first node to the last. Elements can be reached only sequentially, so searching takes $O(n)$.
Q2(b)2 marks · NumericalOpen: A matrix B[10][20] is stored in the memory with each element requiring 2 bytes…

Solve the following.

A matrix $B[10][20]$ is stored in the memory with each element requiring 2 bytes of storage. If the base address at $B[2][1]$ is 2140, find the address of $B[5][4]$ when the matrix is stored in Column Major Wise.
Show answer

Answer

Column major formula (relative to the element whose address is known): Address of $B[I][J] = BA + W \times [(J - L_c) \times M + (I - L_r)]$ Given: number of rows $M = 10$, $W = 2$ bytes, $BA = 2140$ at $B[2][1]$, so $L_r = 2$, $L_c = 1$; $I = 5$, $J = 4$. Address of $B[5][4] = 2140 + 2 \times [(4 - 1) \times 10 + (5 - 2)]$ $= 2140 + 2 \times [30 + 3]$ $= 2140 + 66 = 2206$

Final answer: 2206

Q2(c)2 marks · Short answerOpen: Convert the following infix notation to prefix form: (X + Y) / (Z * W / V)

Answer the following in short.

Convert the following infix notation to prefix form: $(X + Y) / (Z * W / V)$
Show answer

Answer

$(X + Y) / (Z * W / V)$ $X + Y \to +XY$ $Z * W / V$ is evaluated left to right: $Z * W \to *ZW$, then divided by $V \to /*ZWV$ Combining with the outer division: $/ + XY / * ZWV$ Prefix form: $/ + X\ Y\ / * Z\ W\ V$
Q2(d)2 marks · Short answerOpen: State the best case and the worst case complexity for bubble sort algorithm.

Answer the following in short.

State the best case and the worst case complexity for bubble sort algorithm.
Show answer

Answer

Bubble sort: Best case: $O(n)$. This happens when the array is already sorted; the optimised bubble sort makes one pass, finds no swaps and stops. Worst case: $O(n^2)$. This happens when the array is in reverse order; every pass makes swaps and about $n(n-1)/2$ comparisons are needed.
Q2(e)2 marks · Short answerOpen: What is the significance of the keyword ‘new’ in Java? Mention the areas where…

Answer the following in short.

What is the significance of the keyword ‘new’ in Java? Mention the areas where it is used.
Show answer

Answer

The keyword 'new' is an operator that dynamically allocates memory at run time (from the heap) for an object or an array, calls the constructor to initialise it, and returns a reference to the newly created memory. Areas where it is used: 1. To create objects of a class, e.g. $Student\ s = new\ Student();$ 2. To create arrays, e.g. $int\ a[] = new\ int[10];$ 3. To create objects of library classes, e.g. $Scanner\ sc = new\ Scanner(System.in);$ 4. To create nodes of dynamic data structures such as linked lists and trees, e.g. $Node\ t = new\ Node();$
Q35 marks · OutputOpen: The following function check( ) is a part of some class. What will the function…

What is the output of the following code?

The following function check( ) is a part of some class. What will the function check( ) return when the value of (i) n=25 and (ii) n=10. Show the dry run/ working.
int check(int n)
{
    if(n<=1)
        return 1;
    if( n%2==0)
        return 1 + check(n/2);
    else
        return 1 + check(n/2 + 1);
}
Show answer

Answer

Dry run for n = 25: check(25): 25 is odd, so return 1 + check(25/2 + 1) = 1 + check(13) check(13): odd, so 1 + check(13/2 + 1) = 1 + check(7) check(7): odd, so 1 + check(7/2 + 1) = 1 + check(4) check(4): even, so 1 + check(2) check(2): even, so 1 + check(1) check(1): n <= 1, so return 1 Unwinding: check(2) = 1 + 1 = 2; check(4) = 1 + 2 = 3; check(7) = 1 + 3 = 4; check(13) = 1 + 4 = 5; check(25) = 1 + 5 = 6 Return value for n = 25: 6 Dry run for n = 10: check(10): even, so 1 + check(5) check(5): odd, so 1 + check(5/2 + 1) = 1 + check(3) check(3): odd, so 1 + check(3/2 + 1) = 1 + check(2) check(2): even, so 1 + check(1) check(1): returns 1 Unwinding: check(2) = 2; check(3) = 1 + 2 = 3; check(5) = 1 + 3 = 4; check(10) = 1 + 4 = 5 Return value for n = 10: 5 (i) n = 25 returns 6; (ii) n = 10 returns 5 (verified by running the code).
Q4(a)(i)4 marks · K-mapOpen: Reduce the above expression by using 4-variable Karnaugh map, showing the…

Reduce the following using a Karnaugh map.

Reduce the above expression by using 4-variable Karnaugh map, showing the various groups (i.e. octal, quads and pairs).
Show the case
Given the Boolean function: $F(A,B,C,D) = \Sigma (0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14)$.
Show answer

Answer

Groups: (0, 1, 2, 3, 8, 9, 10, 11) → B'; (0, 1, 4, 5, 8, 9, 12, 13) → C'; (8, 10, 12, 14) → AD'

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

Two octets {0,1,2,3,8,9,10,11} = B' and {0,1,4,5,8,9,12,13} = C', and one quad {8,10,12,14} = AD'.
Q4(a)(ii)1 mark · DrawingOpen: Draw the logic gate diagram for the reduced expression. Assume that the…

Reduce the following using a Karnaugh map.

Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs.

Draw: Logic gate diagram for the reduced expression

Show answer

Answer

Logic gate diagram for $F = B' + C' + AD'$: one 2-input AND gate takes A and D'; its output, together with B' and C', feeds a 3-input OR gate whose output is F. The complemented inputs B', C', D' are taken directly as inputs.
Diagram for this answer
Q4(b)(i)4 marks · K-mapOpen: Reduce the above expression by using 4-variable Karnaugh map, showing the…

Reduce the following using a Karnaugh map.

Reduce the above expression by using 4-variable Karnaugh map, showing the various groups (i.e. octal, quads and pairs).
Show the case
Given the Boolean function: $F(A, B, C, D) = \pi ( 3, 4, 6, 9, 11, 12, 13, 14, 15 )$.
Show answer

Answer

Groups: (9, 11, 13, 15) → (A' + D'); (4, 6, 12, 14) → (B' + D); (3, 11) → (B + C' + D')

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

The 0s (maxterms 3,4,6,9,11,12,13,14,15) are grouped: quads {9,11,13,15} = (A' + D') and {4,6,12,14} = (B' + D), pair {3,11} = (B + C' + D').
Q4(b)(ii)1 mark · DrawingOpen: Draw the logic gate diagram for the reduced expression. Assume that the…

Reduce the following using a Karnaugh map.

Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs.

Draw: Logic gate diagram for the reduced expression

Show answer

Answer

Logic gate diagram for $F = (A' + D')(B' + D)(B + C' + D')$: two 2-input OR gates with inputs (A', D') and (B', D), and one 3-input OR gate with inputs (B, C', D'), feed a 3-input AND gate whose output is F. The complemented inputs A', B', C', D' are taken directly as inputs.
Diagram for this answer
Q5(a)5 marks · DrawingOpen: Draw the logic circuit diagram for an octal to binary encoder and explain its…

Draw the following.

Draw the logic circuit diagram for an octal to binary encoder and explain its working when a particular digit is pressed. Also, state the difference between encoders and decoders.

Draw: Logic circuit diagram of an octal to binary encoder

Must show: inputs D0 to D7, outputs A, B, C

Show answer

Answer

Octal to binary encoder: it has 8 input lines $D_0$ to $D_7$ (one for each octal digit, only one is 1 at a time) and 3 output lines $A_2 A_1 A_0$ giving the binary code of the digit pressed. Truth table: $D_0 \to 000$, $D_1 \to 001$, $D_2 \to 010$, $D_3 \to 011$, $D_4 \to 100$, $D_5 \to 101$, $D_6 \to 110$, $D_7 \to 111$. From it: $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$. Each output is a 4-input OR gate. $D_0$ needs no connection: when it is pressed all three outputs stay 0. Working: when a digit is pressed, only its input line becomes 1 and it feeds those OR gates whose equation contains it. For example, pressing 6 makes $D_6 = 1$; $D_6$ feeds the OR gates for $A_2$ and $A_1$ but not $A_0$, so $A_2 A_1 A_0 = 110$, the binary of 6. Pressing 5 gives $D_5 = 1$, which feeds $A_2$ and $A_0$, so the output is 101. Difference: an encoder converts $2^n$ input lines (only one active) into an n-bit binary code (many inputs to few outputs, built with OR gates). A decoder does the reverse: it converts an n-bit binary input into one of $2^n$ output lines, activating exactly one output (few inputs to many outputs, built with AND gates).
Diagram for this answer
Q5(b)3 marks · DrawingOpen: Draw the circuit of a two input XOR gate with the help of NOR gates.

Draw the following.

Draw the circuit of a two input XOR gate with the help of NOR gates.

Draw: Circuit of a two input XOR gate using only NOR gates

Show answer

Answer

XOR from NOR gates (5 NOR gates): Gate 1: $N_1 = (A + B)'$ Gate 2: $N_2 = (A + N_1)' = A'B$ Gate 3: $N_3 = (B + N_1)' = AB'$ Gate 4: $N_4 = (N_2 + N_3)' = (A'B + AB')' = A \odot B$ (XNOR) Gate 5 (both inputs joined, so it works as a NOT gate): $F = N_4' = A'B + AB' = A \oplus B$ Hence the circuit of five NOR gates gives the two input XOR gate.
Diagram for this answer
Q5(c)2 marks · Short answerOpen: Convert the following expression to its cardinal SOP form: F(P,Q,R) = P'Q'R +…

Answer the following in short.

Convert the following expression to its cardinal SOP form: $F(P,Q,R) = P'Q'R + P'QR + PQ'R' + PQR'$
Show answer

Answer

$F(P,Q,R) = P'Q'R + P'QR + PQ'R' + PQR'$ Each term already contains all three variables, so it is a minterm. Writing each in binary ($P'Q'R = 001$, $P'QR = 011$, $PQ'R' = 100$, $PQR' = 110$): $P'Q'R = m_1$, $P'QR = m_3$, $PQ'R' = m_4$, $PQR' = m_6$ Cardinal (sum of minterms) form: $F(P,Q,R) = \Sigma(1, 3, 4, 6)$
Q6(a)5 marks · Truth tableOpen: A company intends to develop a device to show the high status power load for a…

Answer the following using a truth table.

A company intends to develop a device to show the high status power load for a household invertor depending on the criteria given below: • If Air conditioner and Geyser are on OR • If Air conditioner is off, but Geyser and Refrigerator are on OR • If Geyser is off, but Air conditioner and Water purifier are on OR • When all are on The inputs are:
INPUTS
AAir conditioner is on
GGeyser is on
RRefrigerator is on
WWater purifier is on
(In all the above cases 1 indicates yes and 0 indicates no.) Output : X [1 indicates high power, 0 indicates low power for all cases] Draw the truth table for the inputs and outputs given above and write the SOP expression for $X(A,G,R,W)$.
Show answer

Answer

AGRWX
00000
00010
00100
00110
01000
01010
01101
01111
10000
10011
10100
10111
11001
11011
11101
11111

SOP: X = A'GRW' + A'GRW + AG'R'W + AG'RW + AGR'W' + AGR'W + AGRW' + AGRW

X = Σ(6, 7, 9, 11, 12, 13, 14, 15) = A'GRW' + A'GRW + AG'R'W + AG'RW + AGR'W' + AGR'W + AGRW' + AGRW, which reduces to X = AG + AW + GR.
Q6(b)3 marks · Truth tableOpen: Draw the truth table and derive an SOP expression for sum and carry for a full…

Answer the following using a truth table.

Draw the truth table and derive an SOP expression for sum and carry for a full adder. Also, draw the logic circuit for the carry of a full adder.
Show answer

Answer

ABCSUMCARRY
00000
00110
01010
01101
10010
10101
11001
11111
SUM = Σ(1, 2, 4, 7) = A'B'C + A'BC' + AB'C' + ABC. CARRY = Σ(3, 5, 6, 7) = A'BC + AB'C + ABC' + ABC, which reduces to AB + BC + AC (circuit drawn for this).
Diagram for this answer
Q6(c)2 marks · Short answerOpen: Simplify the following expression using Boolean laws: F = [ (X' + Y) · (Y' + Z)…

Answer the following in short.

Simplify the following expression using Boolean laws: $F = [ (X' + Y) \cdot (Y' + Z) ]' + (X' + Z)$
Show answer

Answer

$F = [(X' + Y) \cdot (Y' + Z)]' + (X' + Z)$ $= (X' + Y)' + (Y' + Z)' + (X' + Z)$ (De Morgan's law) $= XY' + YZ' + X' + Z$ (De Morgan's law, involution law) $= (X' + XY') + (Z + YZ')$ (regrouping) $= (X' + Y') + (Z + Y)$ (using $A + A'B = A + B$) $= (Y + Y') + X' + Z$ (regrouping) $= 1 + X' + Z$ (complement law) $= 1$ (null law) So $F = 1$ (verified with the boolean tool: the expression is a tautology).
Q710 marks · ProgramOpen: Design a class Convert to find the date and the month from a given day number…

Write the program described below.

Design a class Convert to find the date and the month from a given day number for a particular year. Example: If day number is 64 and the year is 2020, then the corresponding date would be: March 4, 2020 i.e. (31 + 29 + 4 = 64) Some of the members of the class are given below: Class name : Convert Data members/instance variables: n : integer to store the day number d : integer to store the day of the month (date) m : integer to store the month y : integer to store the year Methods/Member functions: Convert ( ) : constructor to initialize the data members with legal initial values void accept( ) : to accept the day number and the year void day_to_date( ) : converts the day number to its corresponding date for a particular year and stores the date in ‘d’ and the month in ‘m’ void display( ) : displays the month name, date and year Specify the class Convert giving details of the constructor( ), void accept( ), void day_to_date( ) and void display( ). 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 Convert
{
    int n, d, m, y;

    Convert()
    {
        n = 0;
        d = 0;
        m = 0;
        y = 0;
    }

    void accept()
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter day number: ");
        n = sc.nextInt();
        System.out.print("Enter year: ");
        y = sc.nextInt();
    }

    void day_to_date()
    {
        int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        if ((y % 400 == 0) || (y % 100 != 0 && y % 4 == 0))
            days[1] = 29;
        int rem = n;
        m = 0;
        while (m < 12 && rem > days[m])
        {
            rem = rem - days[m];
            m++;
        }
        d = rem;
        m = m + 1;
    }

    void display()
    {
        String mn[] = {"January", "February", "March", "April", "May", "June", "July",
                       "August", "September", "October", "November", "December"};
        System.out.println(mn[m - 1] + " " + d + ", " + y);
    }

    public static void main(String args[])
    {
        Convert ob = new Convert();
        ob.accept();
        ob.day_to_date();
        ob.display();
    }
}
Explanation: The constructor sets all data members to 0. accept() reads the day number and the year. day_to_date() first checks whether the year is a leap year (divisible by 400, or divisible by 4 but not by 100) and sets February to 29 days if so. It then subtracts the days of each month from the day number as long as the remaining number is larger than that month's days; what remains is the date d and the month is m + 1. display() prints the month name, date and year. Tested: for day number 64 and year 2020 the output is March 4, 2020, matching the example (31 + 29 + 4 = 64).
Q810 marks · ProgramOpen: Design a class BinSearch to search for a particular value in an array. Some of…

Write the program described below.

Design a class BinSearch to search for a particular value in an array. Some of the members of the class are given below: Class name : BinSearch Data members/instance variables: arr[ ] : to store integer elements n : integer to store the size of the array Member functions/methods: BinSearch(int nn) : parameterized constructor to initialize n=nn void fillarray( ) : to enter elements in the array void sort( ) : sorts the array elements in ascending order using any standard sorting technique int bin_search(int l, int u, int v) : searches for the value ‘v’ using binary search and recursive technique and returns its location if found otherwise returns -1 Define the class BinSearch giving details of the constructor( ), void fillarray( ), void sort( ) and int bin_search(int, int, int). Define the main( ) function to create an object and call the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class BinSearch
{
    int arr[];
    int n;

    BinSearch(int nn)
    {
        n = nn;
        arr = new int[n];
    }

    void fillarray()
    {
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter " + n + " elements:");
        for (int i = 0; i < n; i++)
            arr[i] = sc.nextInt();
    }

    void sort()
    {
        for (int i = 0; i < n - 1; i++)
        {
            for (int j = 0; j < n - 1 - i; j++)
            {
                if (arr[j] > arr[j + 1])
                {
                    int t = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = t;
                }
            }
        }
    }

    int bin_search(int l, int u, int v)
    {
        if (l > u)
            return -1;
        int mid = (l + u) / 2;
        if (arr[mid] == v)
            return mid;
        else if (v < arr[mid])
            return bin_search(l, mid - 1, v);
        else
            return bin_search(mid + 1, u, v);
    }

    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter the size of the array: ");
        int size = sc.nextInt();
        BinSearch ob = new BinSearch(size);
        ob.fillarray();
        ob.sort();
        System.out.print("Sorted array: ");
        for (int i = 0; i < size; i++)
            System.out.print(ob.arr[i] + " ");
        System.out.println();
        System.out.print("Enter the value to search: ");
        int v = sc.nextInt();
        int pos = ob.bin_search(0, size - 1, v);
        if (pos == -1)
            System.out.println(v + " not found");
        else
            System.out.println(v + " found at index " + pos);
    }
}
Explanation: The constructor stores the size and creates the array. fillarray() reads the elements. sort() arranges them in ascending order using bubble sort (binary search needs a sorted array). bin_search(l, u, v) is recursive: if l > u the value is absent and -1 is returned; otherwise it compares v with the middle element and returns mid if equal, else searches the left half (l to mid-1) or the right half (mid+1 to u). Tested: for the array 45 12 89 7 33 60 the sorted array is 7 12 33 45 60 89 and searching 33 gives index 2.
Q910 marks · ProgramOpen: A class Mix has been defined to mix two words, character by character, in the…

Write the program described below.

A class Mix has been defined to mix two words, character by character, in the following manner: The first character of the first word is followed by the first character of the second word and so on. If the words are of different length, the remaining characters of the longer word are put at the end. Example: If the First word is “JUMP” and the second word is “STROLL”, then the required word will be “JSUTMRPOLL” Some of the members of the class are given below: Class name : Mix Data member/instance variable: wrd : to store a word len : to store the length of the word Member functions/methods: Mix( ) : default constructor to initialize the data members with legal initial values void feedword( ) : to accept the word in UPPER case void mix_word( Mix P, Mix Q ) : mixes the words of objects P and Q as stated above and stores the resultant word in the current object void display( ) : displays the word Specify the class Mix giving the details of the constructor( ), void feedword( ), void mix_word( Mix, Mix ) and void display( ). Define the main( ) function to create objects and call the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class Mix
{
    String wrd;
    int len;

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

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

    void mix_word(Mix P, Mix Q)
    {
        String s = "";
        int min = Math.min(P.len, Q.len);
        for (int i = 0; i < min; i++)
            s = s + P.wrd.charAt(i) + Q.wrd.charAt(i);
        if (P.len > Q.len)
            s = s + P.wrd.substring(min);
        else
            s = s + Q.wrd.substring(min);
        wrd = s;
        len = s.length();
    }

    void display()
    {
        System.out.println(wrd);
    }

    public static void main(String args[])
    {
        Mix a = new Mix();
        Mix b = new Mix();
        Mix c = new Mix();
        a.feedword();
        b.feedword();
        c.mix_word(a, b);
        c.display();
    }
}
Explanation: The constructor sets wrd to an empty string and len to 0. feedword() accepts a word in upper case and stores its length. mix_word(P, Q) takes characters alternately from P and Q for as many positions as the shorter word has, then appends the remaining characters of the longer word at the end, and stores the result in the current object. display() prints the word. Tested: for JUMP and STROLL the output is JSUTMRPOLL, matching the example.
Q10(a)4 marks · ProgramOpen: Specify the class CirQueue giving details of the functions void push(int) and…

Write the program described below.

Specify the class CirQueue giving details of the functions void push(int) and int pop( ). Assume that the other functions have been defined. The main function and algorithm need NOT be written.
Show the case
A Circular queue is a linear data structure which works on the principle of FIFO, enables the user to enter data from the rear end and remove data from the front end with the rear end connected to the front end to form a circular pattern. Define a class CirQueue with the following details: Class name : CirQueue Data members / instance variables: cq[ ] : array to store the integers cap : stores the maximum capacity of the array front : to point the index of the front end rear : to point the index of the rear end Member functions: CirQueue (int max) : constructor to initialize the data member cap=max, front=0 and rear=0 void push(int n) : to add integer in the queue from the rear end if possible, otherwise display the message “QUEUE IS FULL” int pop( ) : removes and returns the integer from the front end of the queue if any, else returns -9999 void show( ) : displays the queue elements
Show answer

Answer

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

int pop()
{
    if (front == rear)
        return -9999;
    int v = cq[front];
    front = (front + 1) % cap;
    return v;
}
Explanation: front and rear both start at 0, so front == rear means the queue is empty. push() checks whether advancing rear (with wrap-around using % cap) would meet front; if so the queue is full and the message QUEUE IS FULL is shown (one position is kept unused to tell a full queue from an empty one). Otherwise the number is stored at cq[rear] and rear moves to the next position circularly. pop() returns -9999 when the queue is empty; otherwise it returns the element at front and moves front forward circularly. Tested with cap = 4: three pushes were accepted, the fourth printed QUEUE IS FULL, pops returned the elements in FIFO order, and a pop on the empty queue returned -9999.
Q10(b)1 mark · DifferentiateOpen: How is a linear queue structure different from a circular queue structure?

Differentiate between the following.

How is a linear queue structure different from a circular queue structure?
Show answer

Answer

In a linear queue, insertion is at the rear and deletion is at the front, and once the rear reaches the last position no more elements can be added even if the front positions have become empty after deletions, so that space is wasted. In a circular queue the last position is connected back to the first position, so rear can wrap around and reuse the vacated positions at the front; the space is used efficiently.
Q115 marks · ProgramOpen: An interface Data is defined with a data member and a method volume( ) which…

Write the program described below.

An interface Data is defined with a data member and a method volume( ) which returns the volume of the implementing shape. A super class Base has been defined to contain the radius of a geometrical shape. Define a sub class CalVol which uses the properties of the interface Data and the class Base and calculates the volume of a cylinder. The details of the members of the interface and both the classes are given below: Interface name : Data Data member: double pi : initialize pi = 3.142 Member functions/methods: double volume( ) Class name: Base Data member/instance variable: rad : to store the radius in decimal Member functions/methods: Base(…) : parameterized constructor to initialize the data member void show( ) : displays the radius with an appropriate message Class name: CalVol Data member/instance variable: ht : to store the height in decimal Member functions/methods: CalVol(…) : parameterized constructor to initialize the data members of both the classes double volume( ) : calculates the volume of a sphere by using the formula ( pi x radius2 x height ) void show( ) : displays the data members of both the classes and the volume of the sphere with appropriate message Assume that the interface Data and the super class Base has been defined. Using the concept of inheritance, specify the class CalVol giving the details of the constructor(…), double volume( ) and void show( ). The interface, super class, main function and algorithm need NOT be written.
Show answer

Answer

class CalVol extends Base implements Data
{
    double ht;

    CalVol(double r, double h)
    {
        super(r);
        ht = h;
    }

    public double volume()
    {
        return pi * rad * rad * ht;
    }

    void show()
    {
        super.show();
        System.out.println("Height = " + ht);
        System.out.println("Volume of the cylinder = " + volume());
    }
}
Explanation: CalVol extends the class Base (to reuse rad and show()) and implements the interface Data (so it must define volume(), which has to be public, and can use the constant pi = 3.142). The constructor passes the radius to the super class constructor with super(r) and stores the height. volume() returns pi x rad x rad x ht, the volume of a cylinder. show() calls super.show() to display the radius, then displays the height and the volume. Note: the question's stem says cylinder while the method description says sphere; the given formula pi x radius^2 x height is that of a cylinder. Tested with stub Base and Data classes: for radius 3.5 and height 10 the volume printed is 384.895.
Q12(a)2 marks · ProgramOpen: A linked list is formed from the objects of the class Node. The class structure…

Write the program described below.

A linked list is formed from the objects of the class Node. The class structure of the Node is given below:
class Node
{
    int n;
    Node next;
}
Write an Algorithm OR a Method to find the product of the integer numbers from an existing linked list. The method declaration is as follows: void Product_Node( Node str )
Show answer

Answer

void Product_Node(Node str)
{
    if (str == null)
    {
        System.out.println("The list is empty");
        return;
    }
    int p = 1;
    Node t = str;
    while (t != null)
    {
        p = p * t.n;
        t = t.next;
    }
    System.out.println("Product = " + p);
}
Explanation: p starts at 1 and a temporary reference t starts at the first node str. The loop multiplies p by the number stored in each node (t.n) and moves t to the next node until t becomes null, i.e. the end of the list. The product is then displayed. Tested: for the list 2, 3, 7 the output is Product = 42.
Q12(b)(ii)1 mark · Binary treeOpen: State the degree of the Nodes E and H.

Answer the following questions from the binary tree.

State the degree of the Nodes E and H.
Show answer

Answer

Degree of a node = number of its children. Node E is a leaf, so its degree is 0. Node H has two children (I and D), so its degree is 2.
Q12(b)(iii)1 mark · Binary treeOpen: Mention the external nodes of the right subtree.

Answer the following questions from the binary tree.

Mention the external nodes of the right subtree.
Show answer

Answer

The right subtree has root C (C, B, E, J). External nodes (leaf nodes with no children) of the right subtree: E and J.

About this board paper

The ISC Computer Science 2020 Question Paper is a board paper for Class 12: 32 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.

By kind of question

KindQuestionsMarks printed*
Program641
Short answer1115
Drawing410
K-map28
Truth table28
Output15
Binary tree33
Differentiate23
Numerical12

By chapter

ChapterQuestionsMarks printed*
Objects432
Boolean Algebra1123
Data structures814
Computer Hardware512
Inheritance, Interfaces and Polymorphism15
Recursion15
Arrays, Strings12
Complexity and Big O notation12

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

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

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

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

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