(Paper) CBSE Class XII : Computer Science Exam Paper Year 2009 (ISC Board)

Disclaimer: This website is NOT associated with CBSE, for official website of CBSE visit - www.cbse.gov.in

CBSE Class XII : Computer Science Exam Paper Year 2009 (ISC Board)

General Instruction:
(i). All working including rough work should be done on the same sheet as, and adjacent to the rest of the answer.
(ii). The intended marks for questions or parts of questions are given in brackets []. (Material to be supplied: Log tables including Trigonometric functions)
(iii). A list of useful physical constants is given at the end of this paper.

PART I

Q1. (a) Obtain the Truth Table to verify the following expression: x.(y+z) = x.y + x.z Also name the law stated above. [2]
(b) Answer the following questions related to the gate given below:

Computer_science_fig1.

(i) What is the output of the above gate if input A = 0, B = 1?
(ii) What are the values of the inputs if output = 1? [2]

(c) Given F = A + (B+C). (D’+E)
Find F’ and show the relevant working in steps. [2]
(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 = A.B + C.D [2]
(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:

(i) Canonical sum-of-product expression (SOP)
(ii) Canonical Product-of-Sum expression (POS)

Q2. (a) State a difference between Linear and Non-Linear Data Structure. Give one example of each. [2]
(b) Convert the following infix expression to its postfix form : [2]
( (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: [2]
x’.y’.z’ + x’.y’.z + x’y.z + x’.y.z’ + x.y’.z + x.y’z

(d) Each element of an array A[20][10] requires two bytes of storage. If the address of A[6][8] is 4000, find the Base Address at A[0][0] when the array is stored as Row Major wise. [2]
(e) Define Inheritance. How is it useful in programming?

Q3. (a) The following 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 (n-2) + trial (n-1);}

//for C++//

void perform (int p)

{ int x;

for(int i=1 ; i<=p; i++) OR

x=trail (i);

cout<<x<<" ";

OR //for Java//

void perform (int p)

{ int x;

for (int i=1 ; i<p; i++)

{

x=trail (i);

System.out.print(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? [1]
(iii) In one line state what the function trial  is doing, apart from recursion? [1]

(b) Answer the following from the diagram of a Binary Tree given below:

Computer_science_fig2

i) Root of the tree [1]
ii) External nodes of the tree. [1]
iii) List the nodes in the tree using Inorder Traversal. [1]
iv) Left subtree. [1]
v) Height of the tree. [1]

PART II ( Section A )

Q4. (a) F(P,Q,R,S) = P’Q’RS’ + P’QRS’ + PQ’R’S + PQ’RS’ + PQ’RS + PQR’S + PQRS’ + PQRS [5]
Use Karnaugh’s Map to reduce the given function F using the SOP form. Draw a logic gate diagram for the reduced SOP form. You may use gate with more than two inputs. Assume that the variables and their complements are available as inputs.

(b) F(A,B,C,D) = n(0,1,2,3,5,7,9,13) [5]
Use Karnaugh’s Map to reduce the given function F using the POS form. Draw a logic gate diagram for the reduced POS form. You may use gate with more than two inputs. Assume that the variables and their complements are available as inputs.

Q5. A provisional store announces a special discount on all its product 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.
• If he/she is a regular customer of the store whose age is less than 65 years and is not an employee of the store.
• 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]
(b)
Reduce X(E,R,S,C) using Karnaugh’s Map [5]
Draw te 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 variable and their complements are available as inputs.

Q 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: [3]
(x.y+z) (y+z’.x)
(c)
From the Logic Circuit diagram given below, name the parts (1), (2), (3) and finally derive the Boolean expression and simplify it: [4]

Computer_science_fig4

Q7. (a) Prove that the complement of A.(A+B).(B+CD)’ is a universal gate. [2]
(b)
Minimise the following expression. At each start step clearly the law used. [3]
(c) Draw the truth table and logic circuit diagram for a decimal to binary encoder. [5]

Q8. (a) State a difference between multiplexers and decoders. Also state a use of each. [2]
(b) Verify the following Boolean expression with the help of a truth table. [3]

Computer_science_fig5

(c) Write the SOP expression, truth table and the logic circuit of full adder. [5]

SECTION-B

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 program must be written in C++/Java.

Q 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 :
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) and 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. [10]

Q 10. A Transpose of an array is obtained by interchanging the elements of the rows and columns. [10]

A class Transarray contains a two dimensional integer array of order [m x 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[] : stores the matrix elements
m : integer to store the number of rows
n : integer to store the number of columns
Member functions :
Transarray : default constructor
Transarray(int mm, int nn) : to initialize 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 disparrary : displays the array in a matrix form

Specify the class Transarray giving the details of the constructors, void fillarray, void transpose(Transarray) and void disparray. You need not write the main function.

Q 11. A library issues books on rental basis at a 2% charge on the cast 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 says, 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
6 to 10
Above 10 days
2.00
3.00
5.00

Design a class Library and another class Compute to perform the task. The details the two classes are given below.

Class name : Library
Data members/instance variables
name : name of the book
author : author of the book
P : price of the book in decimal
Member functions
Library (… ) : parameterized constructor to assign values to data
void show( ) : displays the book details
Class name : Compute(…)
Data members/instance variables
d number of days taken in returning the book
f 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 classL ibrary giving the deta ils of the constructors and void show .U sing the concept of Inheritance, specify the class Compute giving the details of constructor, void fine  and the void display  function. You need not write the main function.

Q 12. A class PrimeFac contains an array of 50 integers. Some of the members of the class are given below : [10]

Class name : PrimeFac
Data members m* stance variables
num[ ] : array to store integers
freq[ ] : 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 constructor, void enter , void frefac ( ) and void disp . You need not write the main function.

Q13. 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 n-1. The Data members and member function of the class Binary are given below:

Class name : Binary
Data members/instance variables :
All : integer array of 100 elements
n : size of the array
l : location of the lower bound
u : 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. [8]

(b) State the Base Case in the recursive function binary_search . [1]

(c) What are the drawbacks of using the recursive technique? [1]

Q 14. A class SortWord has been defined with the following details : [I0]

Class name : SortWord
Data Members/instance variables :
txt : stores the word
len : 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 bubble sort 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.