ISC 2010
COMPUTER SCIENCE
PAPERI
(THEORY)
(Three hours)
(Candidates are allowed additional 15 minutes for only reading the paper. They must not start writing during this time)

Answer all Question in Part I (compulsory) and seven questions from Part II, choosing three questions from Sections A and four questions from
Section B. All working, including rough work, should be done on the same sheet as the rest of the answer. The intended marks for questions or for parts of questions are given in brackets[].

PART I
Answer all questions.
while answering questions in this part indicate briefly your working reasoning wherever required.
Question 1. [10]
(a) Obtain the truth table to verify the following expression: x(y+z) = x.y+x.z also name the law stated above.

(b) Answer the following questions related to the NOR gate given below.
(i) What is the output of the above gate if input A=0, B=1.
(ii) What are the values of the input if output = 1.
(c) Given F = A + (B+C).(D'+E) Find F' and show the relevant working in steps.
(d) State the dual for the following expression and also draw the logic gate diagram for the dual expression obtained using NOR gate only. P = AB + CD
(e) For the given truth table where A,B,C are inputs and X is the
output.
A  B  C  X 
0  0  0  1 
0  0  1  0 
0  1  0  0 
0  1  1  1 
1  0  0  1 
1  0  1  0 
1  1  0  1 
1  1  1  0 
Write Canonical SOP and Canonical POS Expression.
Question 2.
(a) State the difference between Linear and NonLinear data structure. Give one example of each.
Ans: 

(b) Convert the following infix expression to its postfix form.
( ( P * Q ) / ( R / S + T ) ) + U
= = 
(c) 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
(d) Each element of an array A[20][10] requires 2 bytes of storage. If the address of A[6][8] is 4000, find the base address of A[0][0] when array is stored in Row major wise.
Ans: 
(e) Define Inheritance. How it is useful in programming.
Ans: 
Question 3.
(a) The following is a function trial() and perform() are a part of some class. Answer the following parts given below. Show the dry run/working.
int trial(int n)
{
if(n==1)
return 2;
else if(n==2)
return 3;
else
return trial(n2) + trial(n1)
}
// for c++  // for Java 
void perform(int p) { int x; for(int i=1; i<=p; i++) { x=trial(i); cout<<x<<" "; } } 
void perform(int p) { int x; for(int i=1; i<=p; i++) { x=trial(i); System.out.println(x+" "); } } 
(i) What will the function trial() return when the value of n is 4?
[2]
(ii) What will be the output of the function perform() when the value of p is 5?
[2]
(iii) In one line state what the function trial() is doing, apart from recursion? [1]
Ans: (i) 8 (ii) 2 3 5 8 13 (iii) calculating sum of last two digits of Fibonacci series. 

(b) Answer the following from the diagram of a Binary Tree given below: [5]
A
/ \
B C
/ \ / \
D E F G
/ \
H I
(i) Root of the TREE
(ii) External node of the tree
(iii) List the node s in the tree using Inorder Traversal.
(iv) Left subtree.
(v) Height of the Tree.
Ans: 
PART II
Answer seven questions in this Part, choosing three questions from Section A and four from Section B.
SECTION A
Answer any three questions.
Question 4.
(a) F(P,Q,R,S) = P'Q'RS'+P'QRS'+PQ'R'S+PQ'RS'+PQ'RS+PQR'S+PQRS'+PQRS
Use Karnaugh's map to reduce the function F, using the SOP form. Draw a logic gate diagram for the reduced SOP form. You may use gates with more than two inputs. Assume that the variables and their complements are available as inputs. [5]

Pair 1 is m5+m7 Pair 2 is m6+m14 Pair 3 is m8+m9 Pair 4 is m14+m8
Reduce Expression for Quad 1 is A'D' Reduce Expression for Quad 1 is A'C Final SOP expression is A'D'+A'C+AC'D  
(b) Given: F(A,B,C,D) = II(0,1,2,3,5,7,9,13)
Use Karnaugh's map to reduce this function F using the given POS form. Draw a logic gate diagram for the reduced POS form. You may use gates with more than two inputs. Assume that the variables and their complements are available as inputs. [5]

Pair 1 is m2+m3 Pair 2 is m4+m5 Pair 2 is m12+m14 Reduce Exp. for Pair 1 is A+B+C' Reduce Exp. for Pair 2 is A+B'+C Reduce Exp. for Pair 3 is A'+B'+D  
Question 5.
A provisonal store announces a special discount on all its products as a festival offer only to those who satisfy any one of the following conditions:
* If he/she is an employee of the store and has a service of more than 10 years.
OR
* If he/she is a regular customer of the store whose age is less than 65 years & is not an employee of the store.
OR
* If he/she is a senior citizen but not a regular customer of the store.
The inputs are:
E: Employee of the store.
R: Regular customer of the store.
S: Service of the employee is more than 10 years.
C: Senior citizen of 65 years or above.
output:
X Denotes eligible for discount[ 1 indicates Yes and 0 indicates No in all cases ]
(a) Draw the truth table for the inputs and outputs given above and write the SOP expression for X(E,R,S,C). [5]

The Function value is: R(A,B,C,D)=E(5,6,7,10,11,13,14,15) The SOP Expression for R(A,B,C,D) is A'BC'D + A'BCD' + A'BCD + AB'CD' + AB'CD + ABC'D + ABCD' + ABCD 
(b) Reduce X(E,R,S,C) using Karnaugh's map. Draw the logic gate diagram for the reduced SOP expression for X(E,R,S,C) using AND & OR gates. You may use gates with two or more inputs. Assume that the variables and their complements are available as inputs. [5]

Quad 1 (m5+m7+m13+m15) Quad 2 (m6+m7+m14+m15) Quad 3 (m10+m11+m14+m15) Simplified Exp. for Quad 1 is BD Simplified Exp. for Quad 1 is BC Simplified Exp. for Quad 1 is AC So final Reduced Expression is BD+BC+AC
 
Question 6.
a) Draw a truth table representing a 2 input XNOR gate and derive its SOP expression along with its logic gate diagram.[3]
b) Simplify the following expression and convert it to its canonical POS form:
(x.y + z)(y + z'.x) [3]
c) From the logic circuit diagram given below name the parts (1), (2), (3) & finally derive the boolean expression & simplify it: [4]

Question 7.
(a) Prove that the complement of A.(A+B).B.(B+C') is a universal gate. [2]
(b) Minimise the following expression. At each step state clearly the law used.
Y=(A+B').(B+CD)' [3]
(c) Draw the truth table & logic circuit diagram for a decimal to binary encoder. [5]
Question 8.
(a) State a difference between multiplexers & decoders. Also state a use of each. [2]
(b) Verify the following Boolean expression with the help of a truth table.
A(+)(B(.)C)=A(.)(B(+)C) [3]
(c) Write SOP expression, truth table and the logic circuit of full adder. [5]
SECTION B
Answer only four 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. (Flow charts and Algorithms are not required).
(The program must by written in C++ OR Java)
Question 9.
A magic number is a number in which the eventual sum of digits of the number is equal to 1. For example, 172=1+7+2=10
10=1+0=1
then 172 is a magic number.
Design a class Magic to check if a given number is a magic number. Some of the members of the class are given below:
Class name  Magic 
Data members/instance variables  
n 
stores the number 
Member functions/methods:  
Magic()  Constructor to assign 0 to n 
void getnum(int nn)  to assign the parameter value to the number, n=nn 
int Sum_of_digits(int)  returns the sum of the digits of a number 
void ismagic()  checks if the given number is a magic number by calling the function Sum_of_digits(int) & displays appropriate message 
Specify the class Magic giving the details of the constructor ,void getnum(int), int Sum_of_digits(int)and void ismagic(). You need not write the main function.
Questions 10.
A transpose of an array is obtained by interchanging the elements of the rows and columns.
A class Transarray contains a two dimensional integer array of order [m*n]. The maximum value possible for both 'm' and 'n' is 20. Design a class Transarray to find the transpose of a given matrix. The details of the members of the class are given below:
Class name  Transarray 
Data members/instance variables:  
arr[][] m n 
stores the matrix elements
integer to store the number of rows integer to store the number of columns 
Member functions:  
Transarray()  default constructor 
Transarray(int mm, int nn)  to initialise the size of the matrix, m=mm, n=nn 
void fillarray()  to enter the elements of the matrix 
void transpose(Transarray A)  to find the transpose of a given matrix 
void disparray()  displays the array in a matrix form 
Specify the class Transarray giving the details of the constructor, void fillarray(), void transpose(Transarray) and void disparray(). You need not write the main function.
Questions 11.
A library issues books on rental basis at a 2% charge on the cost price of the book per day. As per the rules of the library, a book can be retained for 7 days without any fine. If the book is returned after 7 days, a fine will also be charged for the excess days as per the chart given below:
Number of excess days Fine per day(Rs.)
1 to 5 2.00
6 to 10 3.00
Above 10 days 5.00
Class name  Library 
Data members/instance variables 

name author p 
name of the book
author of the book price of the book in decimals 
Member functions: 

Library(.....)  parameterized constructor to assign values to data members 
void show()  displays the book details 
Class name  Compute 
Data members/instance variables:  
d
f 
number of days taken in returning the book
to store the fine 
Member functions:  
Compute(.....)  parameterized constructor to assign values to data members of both the classes 
void fine()  calculates the fine for the excess days 
void display()  displays the book details along with the number of days, fine and the
total amount to be paid. Total amount is calculated as:
(2% of price of book*total no. of days)+fine 
Specify the class Library giving the details of constructors and void show(). Using the concept of Inheritance, specify the class Compute giving the details of constructor, void fine() & the void display() function. You need not write the main function.
Question 12.
A class PrimeFac contains an array of 50 integers. Some of the members of the class are given below:
Class name  PrimeFac 
Data members/instance variable  
num[]
freq[] 
array to store integers
array to store the frequency of prime factors of numbers 
Member functions:  
PrimeFac() 
Constructor to initialize array elements to 0 
void enter() 
to enter values into array num[] 
void frefac() 
to determine the frequency of prime factors of the numbers stored in num[] and assign it to freq[] 
void disp()  to display both the arrays 
Specify the class PrimeFac giving the details of the constructor, void enter(), void frefac() and void disp() only. You need not write the main function.
Question 13.
Class Binary contains an array of n integers (n<=100)that are already arranged in ascending order. The subscripts of the array elements vary from 0 to n1. The data members and member function of the class Binary are given below:
Class name  Binary 
Data members/instance variables  
A[]
n l u 
integer array of 100 elements
size of the array location of the lower bound location of the upper bound 
Member functions:  
Binary(int nn)  constructor to initialize the size n=nn and the other instance variables 
void readdata()  to fill the elements of the array in ascending order 
int binary_search(int v)  returns the location of the value (v) to be searched in the list by binary search method using the Recursive technique. The function returns 1 if the number is not present in the given list 
(a) Specify the class Binary giving the details of the constructor, void readdata() and int binary_search(int). You need not write the main function.
(b) State the Base Case in the recursive function binary_search().
(c) What are the drawbacks of using the recursive technique?
Question 14.
A class SortWord has been defined with the following details:
Class name  SortWord 
Data members/instance variables:  
txt
len 
stores the word
stores the length of the word 
Member functions:  
SortWord()  default constructor 
void readTxt()  to accept the word in lower case 
void sortTxt()  to sort the word in alphabetical order of characters using bubblesort technique and display it 
void changeTxt()  to change the case of vowels in the word to UPPER case (for e.g. school becomes schOOl) 
void disp()  to display the changed string 
Specify the class SortWord giving the details of the functions constructor, void readTxt(), void sortTxt(), void changeTxt() and void disp(). You need not write the main function.
=*=*=*=*=*=