i1660130613rOswaal ISC 12th Computer Science_Practice Paper-2
i1660130613rOswaal ISC 12th Computer Science_Practice Paper-2
SOLUTIONS
1. (a) Truth value is defined as truth or falsity of a (e) (i) leaf: The node which does not have a child
proposition. is called as LEAF Node.
(b) The decision which result into either Yes or No (ii) Degree: The number of children of a node
is called a Binary Decision. is called degree of the tree.
(c) Minterm designation 3.
UVW = 100
Decimal equivalent
= 1 × 22 + 0 × 21 + 0 × 20 = 4.
UVW = m4 Output: 75
Maxterm Designation The given function returns th sum of square of the
UVW = 011 digits.
Decimal equivalent 4. (a) (i)
= 0 × 22 + 1 × 21 + 1 × 20
= 0 + 2 + 1 = 3
UVW = m3
(d)
Quad 1 = m0 + m4 + m8 + m12
(e) The translation of boolean algebra into the gates
form is known as logic circuit. = yz
2. (a) Finally block is always executed whether (ii)
exception is handled or not.
Exceptions are events occurring at the runtime
of a program that disrupt the overall execution
of the program. (b) (i) F(A, B, C, D) = p(0, 1, 3, 5, 6, 7, 10, 14, 15)
(b) The automatic conversion that the Java
computer makes between the primitive types
and their corresponding object wrapper classes
is called autoboxing.
Primitive types should be preferred over
wrappers as wrapper types are immutable and
their use may sometimes become impossible.
(c) The elements of 2-D arrays are allocated
contiguous memory locations.
To enable this storage array is linearized in two
ways i.e. in Row-major or Column-major.
Pair 1 = M0M1 = (A+B+C)
(d) Two applications of queues are:
Pair 2 = M10M14 = (A+C+D)
(i) For implementing any computational FIFO
service e.g., printer queues, disk queues etc. Quad 1 = M1M3M5M7 = (A+D)
(ii) For handling scheduling of processes in a Quad 2 = M5M7M14M15 = (C+B)
multitasking operating system e.g. FCFS F(A, B, C, D) = (A+B+C)(A+C+D)
scheduling. (A+D)(C+B)
2 Oswaal ISC Question Bank Chapterwise & Topicwise, COMPUTER SCIENCE, Class-XII
5. (a)
Hexadecimal Number F3 F2 F1 F0
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
(c) A·B+B·C = A·B(C+C)+(A+A)B·C
3 0 0 1 1
= ABC+ABC+ABC+ABC
4 0 1 0 0
= ABC+ABC+ABC
5 0 1 0 1 6. (a) (i)
6 0 1 1 0
R P D H T
7 0 1 1 1
0 0 0 0 0 M0 = R+P+D+H
8 1 0 0 0
0 0 0 1 0 M1 = R+P+D+H'
9 1 0 0 1
0 0 1 0 0 M2 = R+P+D'+H
A 1 0 1 0
0 0 1 1 0 M3 = R+P+D'+H'
B 1 0 1 1
0 1 0 0 0 M4 = R+P'+D+H
C 1 1 0 0
0 1 0 1 1 M8 = R'+P+D+H
D 1 1 0 1
0 1 1 0 1 M9 = R'+P+D+H'
E 1 1 1 0
0 1 1 1 1 M12 = R'+P'+D+H
F 1 1 1 1
1 0 0 0 0
Circuit diagram for Hexdecimal to Binary
encoder 1 0 0 1 0
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
T(R, P, D, H) = p(0, 1, 2, 3, 4, 8, 9, 12)
(ii)
SOLUTIONS 3
n=0;
}
void inputnum(int no)
{
n=no;
}
int digitsSum(int num)
{
int d=0, sum=0;
Quad 1 (M0 M1 M8 M9) = (P+D) while (num>0)
Quad 2 (M0 M1 M2 M3) = (R+P) {
Quad 4 (M0 M4 M8 M12) = (D+H) d=num%10;
\ T(R, P, D, H) = (P+D)(R+D)(D+H) sum=sum+d;
(b) NOR=NOR can be implemented with 2-level num=num/10;
OR-AND implementation. F here should be in a }
product of sum form, i.e., return sum;
F(a, b, c, d) = Sm(1, 3, 4, 6, 9, 12) }
= pM(0, 2, 5, 7, 8, 10, 11, 13, 14, 15) void ismagic()
using K-map {
int num;
int sum=digitsSum(n);
while (sum>9)
{
num=sum;
sum=digitssum(num);
}
if (sum==1)
Quad 1 (M0 M2 M8 M10) = (b+d) system.out.println(n+"is a magic
Quad 2 (M5 M7 M13 M15) = (b'+d') number.");
Quad 3 (M10 M11 M14 M15) = (a'+c') else
\ F(a, b, c, d) = (b+d)(b'+d')(a'+c') system.out.println(n+"is NOT a
magic number");
}
}
8. import java.util.scanner;
class word
{
String str;
(c) A·(A'+B)·C·C·(A+B)
word()
= A·A'+A·B·C·(CA+CB)
{
= 0+A·B·C(CA+CB)
str="";
= A·B·C·(CA+CB)
}
= A·B·C·C·A+A·B·C·C·B
void readword()
= ABC+ABC
{
= ABC
scanner sc=new scanner(system.in);
7. import java.util.scanner;
System.out.println("Enter a word:");
Public class Magic
str=sc.next();
{
}
int n;
void arrange()
Magic()
{
{
4 Oswaal ISC Question Bank Chapterwise & Topicwise, COMPUTER SCIENCE, Class-XII
{ (b) (i) A B D E C F G
prev=ptr; (ii)
ptr=ptr.next;
count++;
}
prev.next=ptr.next;
ptr.next=null;
(iii) D, E & G
}