Isc Computer Science 2024
Isc Computer Science 2024
COMPUTER SCIENCE
Solved Paper
Class-12th
Maximum Marks: 70
Time allowed: Three hours
(Candidates are allowed additional 15 minutes for only reading the paper. They must NOT start writing during this time.)
Answer all questions in Part I (compulsory) and six questions from Part-II, choosing two
questions from Section-A, two from Section-B and two from Section-C.
All working, including rough work, should be done on the same sheet as the rest of the answer.
The intended marks for questions or parts of questions are given in brackets [].
---------------------------------------------------------------------------------------------------------------------------------
PART I-20 MARKS (d) Assertion is false but Reason is true.
Answer all questions. (vii) State any one use of interfaces in Java. [1]
While answering questions in this Part, indicate briefly (viii) Write the cardinal form of the maxterm X + Y’ +Z
your working and reasoning, wherever required. (ix) Write the canonical SOP expression for F (A, B) = A
Question 1 <=> B [1]
(i) According to the Principle of duality, the Boolean (x) State any one difference between instance variable
equation (A+B’) • (A+1)= A + B’ will be equivalent and class variable. [1]
to: [1] Question 2
(a) (A’+B) • (A’+ 1) = A’ + B (i) Convert the following infix notation to postfix form.
(b) (A • B’)+(A • 0) = A • B’ [2]
(c) (A’ • B)+(A’ • 1) = A’ • B (P+Q•R-S)/T•U
(d) (A’ • B)+(A’ • 0) = A’ • B (ii) An array ARR [-5.....15, 10....20] stores elements
(ii) When a sequence of OR, NOT, NOR are connected in Row Major Wise with each element requiring 2
in series, the logic gate obtained is: [1] bytes of storage. Find the address of ARR [10] [15]
(a) AND (b) NOT when the base address is 2500. [2]
(c) OR (d) XOR (iii) The following function is a part of some class:
(iii) Idempotence Law states that: [1] int jolly(int[ ] x, int n, int m)
(a) X + X = X (b) X + X’ = 0 {
(c) X + X = 1 (d) X + X’ = X if (n < 0)
(iv) Assertion: For proposition ~A =>B its contrapositive return m;
is B=> ~ A [1] else if(n<x.length)
Reason: Contrapositive is the converse of inverse m= (x[n] > m) ?x[n]:m;
for any proposition. return jolly(x, - -n, m);
(a) Both Assertion and Reason are true, and Reason }
is the correct explanation for the Assertion. (a) What will be the output of jolly( ) when the
(b) Both Assertion and Reason are true, but Reason value of x[ ]= {6, 3, 4, 7, 1}, n = 4 and m = 0?[2]
is not the correct explanation for the Assertion. (b) What function does jolly() perform, apart from
(c) Assertion is true but Reason is false. recursion? [1]
(d) Assertion is false but Reason is true. (iv) The following function is a part of some class which
(v) The complement of the Boolean expression (P’ ⋅ Q) is used to find the smallest digit present in a number.
+ (R • S’) is: [1] There are some places in the code marked by ?1?,
(a) (P’ + Q) • (R’ + S) ?2?, ?3? which must be replaced by an expression / a
(b) (P + Q’) • (R’ + S) statement so that the function works correctly.
(c) (P’ + Q) • (R + S’) int small_dig(int n)
(d) (P + Q’) • (R + S’) { int min =? 1 ? ;
(vi) Assertion: Recursive data structure follows the while (n ! = 0)
LIFO principle. [1] {
Reason: Execution of recursive code follows the int q = n / 10
concepts of data structure Queue. int r =?2? * 10;
(a) Both Assertion and Reason are true, and Reason min = r > min ? 3 ? : r;
is the correct explanation for the Assertion. n = q;
(b) Both Assertion and Reason are true, but Reason }
is not the correct explanation for the Assertion. return min;
(c) Assertion is true but Reason is false. }
2 Oswaal ISC, COMPUTER SCIENCE, Class-XII
ANSWERS
PART I (iv) Option (d) is correct.
Answer 1 Explanation: The contrapositive of a proposition
(i) Option (b) is correct. is formed by negating both the consequent (the
Explanation: Principle of Duality states that if we “then” part) and the antecedent (the “if ” part) and
have true Boolean postulates or equations then the then reversing their order. It is logically equivalent
dual of this statement equation is also true. to the original proposition.
Also to get dual of an expression following changes The contrapositive of the proposition ~A -> B is ~B
are done : -> A
+ to . (v) Option (b) is correct.
. to + Explanation: (P’Q + RS’)’
1 to 0 (P’Q)’ ∙ (RS’)’
0 to 1 (P”+Q’) ∙ (R’ + S”)
(ii) Option (c) is correct. (P+Q’) ∙ (R’+S)
Explanation: When you connect these gates in (vi) Option (b) is correct.
series, the output of one gate becomes the input of Explanation: Going with the implementation of
the next gate. stack , reverse strings etc. a recursive data structure
(A+B)’ = A’B’ follows the reverse order , last in first out.
(A’B’ +A’B’) ’= (A’B’)’= A+ B (vii) They are used to achieve abstraction,
However, you can analyze its behavior based on the polymorphism, and multiple inheritance.
operations of each gate: While getting the Cardinal form , the non
If the input to the OR gate is true (1), its output will complemented variables are written as 0 and the
be true (1). complemented variables are written as 1.
The NOT gate then negates this output, so it The binary combination formed is then converted
becomes false (0). to decimal equivalent.
Finally, the NOR gate receives false (0) as its input. (viii) (X + Y’ + Z): 010
Since both inputs are false (0), the NOR gate outputs Decimal Equivalent of binary pattern 010: 2
true (1). Hence, Cardinal form is M2
So, in this specific combination, the output would Cardinal form : If an expression is represented in its
be true only if the input to the OR gate is true. decimal equivalent of its terms.
(iii) Option (a) is correct. (ix) The canonical SOP expression for F(A,B) is:
Explanation: Idempotent Law – An input that is F(A,B)=A’∙B’+A∙B
AND´ed or OR´ed with itself is equal to that input · Cardinal form: If an expression is represented in its
e.g X+X= X , X.X =X decimal equivalent of its terms.
Solved Paper - 2024 5
A⇔B we first need to create a truth table for the (iii) (a) Output: 7
function: Explanation:
Given the array ‘x={ 6, 3, 4, 7, 1}`, `n= 4’, and ‘m=
A B F(A,B)
0 ’, let’s compute the output step by step:
0 0 1 1. `jolly(x, 4, 0) `:
0 1 0 • `n = 4`, SO `n <x.length` is true.
1 0 0 • `m = (x[4] > m) ? x[4]: m`, which is `m (1>0) ? 1
:0`,so`m` becomes ‘1’.
1 1 1 • Recursively call `jolly(x, 3, 1)’.
From the truth table, we can see that F(A, B) is true 2. `jolly(x, 3, 1)’:
(1) when either both A and B are false (0) or both A • ‘n = 3’, SO ‘n <x.length‘is true.
and B are true (1). • ‘m = (x[3] > m) ? x[3] : m’ , which is ‘m = (7>1) ? 7:
Now to construct the SOP expression, we take 1’, SO `m`becomes ‘7’.
the minterms (rows in the truth table where the • Recursively call ‘jolly(x, 2, 7)’ .
function is true) and negate them. Then, we tave 3. ‘jolly(x, 2, 7)’:
the product (AND) of these terms. • ‘n =2`, so ‘n< x. length’ is true.
The minterms for which F(A, B) =1 are m0 and m3: • ‘m= (x[2] > m) ? x [2] : m`, which is `m (4>7)?4: 7`,
• m0: A = 0,B =0, so the term A’∙B’. SO `m`remains ‘7’.
• m3: A = 1,B =1, so the term A∙B. • Recursively call ‘jolly(x, 1, 7)’.
(x) The main difference is that instance variables 4. ‘Jolly(x, 1, 7)’:
are unique to each instance of a class, while class • ‘n= 1’, so ‘n<x.length’ is true.
variables are shared among all instances of the class
• ‘m=(x[1] > m) ? x[1] : m’, which is `m = (3>7) ?3
and are associated with the class itself.
:7’, so ‘m’ remains ‘7’.
Answer 2
• Recursively call ‘jolly(x, 0,7)’.
(i) Postfix form: PQR*+S-T/U*
5. ‘jolly(x, 0, 7)’:
S No. Expression Stack Postfix • ‘n = 0, so ‘n < 0’ is false.
0 ( ( • ‘n <x.length’ is true.
• ‘m= (x[0] > m) ? x[0], which is ‘m (6>7) ?6 :7’, so ‘m’
1 P ( P remains ‘7’.
2 + (+ P • Recursively call ‘jolly(x, -1, 7)’ .
3 Q (+ PQ 6. ‘jolly(x, -1, 7)’:
• ‘n =-1, so ‘n <0’ is true, and it returns ‘m’, which is
4 * (+* PQ
‘7’.
5 R (+* PQR So, the output of the ‘jolly()’ function with the given
6 - (- PQR*+ parameters will be ‘7’.
7 S (- PQR*+S (b) T he jolly() function performs the task of finding
the maximum value in a given array x up to
8 ) PQR*+S- index n, while keeping track of the maximum
9 / / PQR*+S- value encountered so far in the parameter m.
10 T / PQR*+S-T (iv) (a) n%10
(b) q
11 * * PQR*+S-T/ (c) min
12 U * PQR*+S-T/U
SECTION-A
13 PQR*+S-T/U* Answer 3
(i)
(ii) Number or rows say M = (Ur – Lr) + 1 = [15 – (- 5)]
+1 = 21 P S E B X
Number or columns say N = (Uc – Lc) + 1 = [20 –
0 0 0 0 0
10)] +1 = 11
Row Major Wise Calculation 0 0 0 1 0
The given values are: B = 2500, W = 2 byte, I = 10, J 0 0 1 0 0
= 15, Lr = -5, Lc = 10, N = 11 0 0 1 1 0
Address of A [ I ][ J ] = B + W * [ N * ( I – Lr ) + (
J – Lc ) ] 0 1 0 0 0
= 2500 + 2* [11 * (10 – (-5)) + (15 – 10)] 0 1 0 1 0
= 2500 + 2 * [11 * 15 + 5] 0 1 1 0 1
= 2500 + 2 * [165 + 5]
0 1 1 1 1
= 2500 + 340
= 2840 1 0 0 0 0
6 Oswaal ISC, COMPUTER SCIENCE, Class-XII
1 0 0 1 1 (i) (a)
1 0 1 0 1
1 0 1 1 1
1 1 0 0 0
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
SE + PB + PE
Answer 4 (ii)
// Constructor
public DeciHex()
{
num = 0;
hexa=””;
}