ISC computer science class XII sample paper 2
Answer all questions in Part I (compulsory) and seven 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
Answer all
questions
Question 1.
A) Verify if, P.(~P+Q’)=(P→Q) using truth table.
A) Verify if, P.(~P+Q’)=(P→Q) using truth table.
B) Find the complement of
F(A,B,C,D)= [A + { ( B+C) . (B’+ D’)}]
F(A,B,C,D)= [A + { ( B+C) . (B’+ D’)}]
C) Find the dual for the Boolean equation.
AB’ + BC’ +1 =1
D) If A=1, B=0, C=1 and D=1 find its
i) maxterm
ii) minterm
E) Simplify the following expression by using the Boolean laws. Show the working in steps and also mention the laws used.:
X’Y’Z’ + X’Y’Z+ X’YZ+X’YZ’+ XY’Z’+ XY’Z [ 1 x 5 = 5]
Question 2.
a)State the different applications of stack.
D) If A=1, B=0, C=1 and D=1 find its
i) maxterm
ii) minterm
E) Simplify the following expression by using the Boolean laws. Show the working in steps and also mention the laws used.:
X’Y’Z’ + X’Y’Z+ X’YZ+X’YZ’+ XY’Z’+ XY’Z [ 1 x 5 = 5]
Question 2.
a)State the different applications of stack.
b) Convert the following infix notation to
postfix:
(A+ ( B*C)) / (C-(D*B))
(A+ ( B*C)) / (C-(D*B))
c) Explain any two standard ways of traversing a
binary tree.
d) A two dimensional array defined as X[3…6,
-2…2] requires 2 bytes of storage space for each element. If the array is stored
in row major order, determine the address of X[5,1], given the base address as
1200.
e)
i) What is the worst-case complexity of the following code segment
:
for(int i=0;i<N;i++)
{
Sequence of statements
}
for(int j=0;j<M; j++)
{
Sequence of statements
}
ii) How would the complexity change if the second loop went to N instead of M?
for(int i=0;i<N;i++)
{
Sequence of statements
}
for(int j=0;j<M; j++)
{
Sequence of statements
}
ii) How would the complexity change if the second loop went to N instead of M?
[
2 x 5 =10]
Question 3.
The following is a function of some class. What will be the output of the function recs( ) when the value of num is equal to 4?Show the dry run / working.
int recs(int num)
The following is a function of some class. What will be the output of the function recs( ) when the value of num is equal to 4?Show the dry run / working.
int recs(int num)
{
if(num==0)
return
0;
else
return
num+ recs(num-1);
}
[
5 ]
Part II
Answer six questions in this part, choosing two questions from Section A, two from Section B and two from Section C.
Section A
Answer any two questions
Answer six questions in this part, choosing two questions from Section A, two from Section B and two from Section C.
Section A
Answer any two questions
Question 4.
a) Given F(P,Q,R,S)= Σ(0,1,3,4,5,6,7,9,10,11,13,15)
i) Reduce the above expression by using 4
variable Karnaugh map, showing the various groups( i.e. octal, quads and
pairs). [
4 ]
ii) Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs. [ 1 ]
ii) Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs. [ 1 ]
b) Given G(X,Y,Z,W)= π(0,2,4,6,8,9,10,11)
i) Reduce the above expression by using 4
variable Karnaugh map, showing the various groups(i.e.octal, quads and pairs). [
4 ]
ii) Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs. [ 1 ]
ii) Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs. [ 1 ]
Question 5.
a) Differentiate between XNOR and XOR gates. Draw the truth table and logic diagrams of three input XNOR gates. [ 4 ]
a) Differentiate between XNOR and XOR gates. Draw the truth table and logic diagrams of three input XNOR gates. [ 4 ]
b)
Differentiate between proposition and wff. [ 2 ]
c) Define
half adder. Construct the truth table and logic diagram of a half adder. [ 4 ]
Question 6.
a) Draw the logic gate diagram for the Boolean function F(A,B,C)= (A’+B).(B’+C) making use of NOR gates only. [ 3 ]
a) Draw the logic gate diagram for the Boolean function F(A,B,C)= (A’+B).(B’+C) making use of NOR gates only. [ 3 ]
b) Define proposition. How does
tautology differ from contradiction? [ 2 ]
c) Convert
(X’+Y+Z’).(X+Y’+Z).(X+Y+Z’).(X+Y+Z) into SOP form. [ 2 ]
d) Briefly explain the working of a 4:1 multiplexer. Also draw the logic
diagram of 4:1 multiplexer.[
3 ]
Section B
Answer two questions
Answer two questions
Each program should be written in such a way
that it clearly depicts the logic of the problem. This can be achieved by using
mnemonic names and comments in the program. (Flowcharts and algorithms are not required)
The programs must be written in Java.
The programs must be written in Java.
Question 7.
A class Matrix contains a two dimensional integer array of order [ m x n ]. The maximum value possible for both m and n is 25. Design a class Matrix to find the difference of the two matrices. The details of the members of the class are given below:
Class name : Matrix
Data members
arr [][] : stores the matrix element
m : integer to store the number of rows
n : integer to store the number of columns
Member functions:
Matrix(int mm, intnn) : to initialize the size of the matrix m=mm and
n=nn
Void fillarray() : to enter the elements of the matrix
Matrix SubMat(Matrix A) : subtract the current object from the
matrix of parameterized object and return the resulting object.
void display() : display the matrix elements.
Specify the class Matrix
giving details of the constructor Matrix(int,int), void fillarray(),Matrix SubMat(Matrix)
and void display(). Define the main() function to create an object and call the
functions accordingly to enable the task.
[10]
Question8.
A class Modify has been defined with the following details:
A class Modify has been defined with the following details:
Class name : Modify
Data members
St : stores a string
len : to store the length of the string.
Member functions
void read() : to accept the string in uppercase
alphabets.
Void putin(int , char) : to insert a character at the specified
position in the string and display the changed string.
void takeout(int) : to remove character from the specified
position in the string and display the changed string.
void change() : to replace each character in the
original string by the character which is at a distance of 2 moves ahead. For
example:- “ABCD” becomes“ CDEF”, “XYZ” becomes “ZAB”.
Specify the class Modify
giving details of the functions void read(), void putin(int,char), void
takeout( int )and
void change(). The main
function need not be written.
[
10 ]
Question 9.
A Special number is a number in which the sum of the factorial of its digits is equal to the number.
Example 1445 ( 1! + 4! + 5!= 145). Thus, 145 is a special number.
Question 9.
A Special number is a number in which the sum of the factorial of its digits is equal to the number.
Example 1445 ( 1! + 4! + 5!= 145). Thus, 145 is a special number.
Design a class Special to
check if the given number is a Special number or not. Some of the members of the
class are given below:
Class name : Special
Data members
n : integer to store the number
Member functions
Special() : default constructor
void read() : to accept the number
int factorial(int x) : return the factorial of a number using recursion technique
Boolean isSpecial() : checks for the special number by invoking the function factorial() and returns true if Special, otherwise returns false.
void display() : to show the result with an appropriate message
Class name : Special
Data members
n : integer to store the number
Member functions
Special() : default constructor
void read() : to accept the number
int factorial(int x) : return the factorial of a number using recursion technique
Boolean isSpecial() : checks for the special number by invoking the function factorial() and returns true if Special, otherwise returns false.
void display() : to show the result with an appropriate message
Specify the class Special
giving details of the constructor, void read(), int factorial() , Boolean isSpecial
()and void display().
Define the main function to create an object and call the functions accordingly to enable the task.
[ 10 ]
Define the main function to create an object and call the functions accordingly to enable the task.
[ 10 ]
Section C
Answer any two questions
Answer any two questions
Each program should be written in such a way that it clearly depicts the logic of the problem step wise. This can also be achieved by using comments in the program and mnemonic names or pseudo codes for algorithms. The program must be written in Java and the algorithms must be written in general/standard form, wherever required/ specified. (Flowcharts are not required.)
Question
10.
A Super class Student defines the personal data of a student while another class Marks defines the register number, name of subject and marks obtained by the student. The details of both the classes are given below:
A Super class Student defines the personal data of a student while another class Marks defines the register number, name of subject and marks obtained by the student. The details of both the classes are given below:
Class name : Student
Data members
name : string to store name.
sex : string to store sex
age : integer to store age
Member functions
Void inpdetails() : to accept
values for data members.
void show() : to display personal
data of student.
Class name : Marks
Data members
regnum :int to store registration
number.
marks :int to store marks.
subject : String to store subject
name.
Member functions
Void inpdetails() : to accept
values for data members.
void show() : to display exam and
student details.
Assume that the super class Student
has been defined. Using the concept of
inheritance specify the class marks giving details of the constructor, void
inpdetails() and void show().The super class and the main function need not be
written. [ 5 ]
Question
11.
Define a class Repeat which allows the user to add elements from one end (rear) and remove elements from the other end (front) only. The following details of the class Repeat are given below:
Define a class Repeat which allows the user to add elements from one end (rear) and remove elements from the other end (front) only. The following details of the class Repeat are given below:
Class name : Repeat
Data members
st[] : an array to hold a maximum of 100 integer elements
cap : stores the capacity of the array
f : to point to the index of the front
r : to point to the index of the rear
Member
functions
Repeat(int
m) : constructor to initialize the data members cap=m, f=0, r=0 and to create
the integer array
Void pushvalue(int
v) : to add integers from the rear index if possible else display the message
“overflow”
Int popvalue()
: to remove and return element from the front, if array is empty then return
-9999
Void disp()
: displays the elements present in the list
Specify the
class Repeat giving details of the constructor Repeat(int), member function
void pushvalue(int), int popvalue().Assume that other functions have been
defined.The main function need not be written. [
5 ]
Question 12.
A) linked list is formed from the objects of the class,
class Node
{
int info;
Node link;
}
Write an algorithm OR a method for deleting a node from a linked list. The method declarationis given below:
void deletenode(Node start) [ 2 ]
A) linked list is formed from the objects of the class,
class Node
{
int info;
Node link;
}
Write an algorithm OR a method for deleting a node from a linked list. The method declarationis given below:
void deletenode(Node start) [ 2 ]
b) Answer the following questions from the
diagram of a binary tree given below:-

ii) Write the post order tree traversal. [
1 ]
iii) Write the internal nodes of the tree. [ 1 ]
iv) State the level of the root of the tree. [ 1 ]
iii) Write the internal nodes of the tree. [ 1 ]
iv) State the level of the root of the tree. [ 1 ]
No comments:
Post a Comment