0% found this document useful (0 votes)
42 views4 pages

Class 12 Selection 23-24

The document is an examination paper for Class XII Computer Science, covering various topics including Boolean algebra, logic circuits, and programming concepts. It consists of multiple-choice questions, theoretical questions, and practical programming tasks related to Fibonacci strings and prime number identification. The exam is structured into two parts, with a total of 70 marks allocated.

Uploaded by

tutor nag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views4 pages

Class 12 Selection 23-24

The document is an examination paper for Class XII Computer Science, covering various topics including Boolean algebra, logic circuits, and programming concepts. It consists of multiple-choice questions, theoretical questions, and practical programming tasks related to Fibonacci strings and prime number identification. The exam is structured into two parts, with a total of 70 marks allocated.

Uploaded by

tutor nag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

M.P.

BIRLA FOUNDATION HIGHER SECONDARY SCHOOL


SELECTION EXAMINATION (2023-2024)
CLASS XII
SUBJECT - Computer Science (Theory)

Writing Time : 3 Hours Maximum Marks :70


PART I
Answer all questions.
While answering questions to this part, indicate briefly your working and reasoning, wherever required.

Question 1. [1x10=10]

i. Which of the following property is correct for X +0 = 0 + X = X ?

(a) Commutative property

(b) Inversion property

(c) Associative property

(d) Identity element

ii.. According to Boolean Law, A + 1 = ?

(a) 1 (b) A (c) 0 (d) A’

iii. What do you understand by Sum of Product?

(a) Sum of Minterms

(b) Sum of Maxterms

(c) Both a and b

(d) Max terms

iv. What is the other name of OR relation ?

(a) Logical multiplication

(b) Logical addition

(c) Logical Subtraction

(d) None of these

v. What is the other name of AND relation?

(a) Logical multiplication

(b) Logical addition

1
(c) Logical Subtraction

(d) None of these

vi. When grouping cells within a K-map, the cells must be combined in groups of

(a) 2 (b) 1,2,4,8 etc (c) 4 (d) 3

vii. NAND and NOR gates are also called Universal gates because

(a) It can be found in almost all digital circuits.

(b) It can be used to build all other types of gates.

(c) These are used in all countries of the world.

(d) These were the first gates to be integrated.

viii. State the Commutative Law of addition for two variables

(a) A + B = A.B (b) A + B = B + A (c) AB = A + B (d) None of these

ix. (A + B)(A’ *B’) = ?

(a) 1 (b) 0 (c) AB (d) AB’

x. Solve Y = AB’ + (A’ + B)C

(a) AB + AC (b) AB’ + C (c) A’B + AC’ (d) AB + A

Question 2.

Question 2.
(a) Convert the following infix notation to its postfix form: [2]
A+(B/C-D)+T*V
(b) Draw the simplified diagram using NAND gates F ( A, B, C )= ∑( 0, 1, 2, 5 ) [2]
(c) In an array of real numbers ARR[-25 . . . 10, -10 . . . 20 ], Base Address is 1234.Find the address of ARR[6][8]
when the array is stored row-major wise. Assume each real number requires 4 bytes. [2]
(d) The following is a function of some class. What will be the output of the function test ( ) when the value of
count is equal to 4 ? Show the dry run / working. [4]
void test (int count )
{
if ( count = = 0)
System.out.println(“ ” );
else
{ System.out.println( “Bye” + count);
test( --count ); System.out.println(“ ” + count);
}
}

2
Answer all questions
PART II

SECTION-A

Question 3.
a) State the difference between half adder and full adder circuits giving the details of
truth table and the circuit diagram of both adders. [6]
b) Draw the truth table and logic circuit diagram for an octal to binary encoder. Briefly explain the
working. [4]
Question 4. [5x2=10]
a) Given the Boolean function F(P,Q,R,S)= ∑(0,1,3,4,5,6,7,9,10,11,13,15)
Using Karnaugh’ map to reduce the function F, using SOP form. Draw the logic gate diagram
of the reduced SOP form. You may use gates with more than 2 inputs. Assume that the
variables and their complements are available as inputs.
b) Given the Boolean function F(P,Q,R,S)= π(3,8,10,12,13,14,15)
Using Karnaugh’ map to reduce the function F, using POS form. Draw the logic gate diagram
of the reduced POS form. You may use gates with more than 2 inputs. Assume that the
variables and their complements are available as inputs.

SECTION-B
Answer all 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.

Question 5.
A sequence of Fibonacci strings is generated as follows:
S0 = “a”, SF = “b”, Sn = S(n-1) + S(n-2) where ‘+’ denotes concatenation. Thus the sequence is:
a, b, ba, bab, babba, babbabab,……. n terms. [10]
Design a class FiboString to generate Fibonacci strings. Some of the members of the class are given
below:
Class name: FiboString
Data members/instance variables:
x: to store the first string
y: to store the second string
z: to store the concatenation of the previous two strings
n: to store the number of terms
Member functions/methods:
FiboString(): constructor to assign x=”a”, y=”b” and z=”ba”
void accept(): to accept the number of terms ‘n’
void generate(): to generate and print the Fibonacci strings. The sum of (‘+’ ie concatenation) first two
strings is the third string. Eg. “a” is first string, “b” is second string then the third will be “ba”, and fourth will
be “bab” and so on.
Specify the class FiboString, giving details of the constructor(), void accept() and void generate(). Define
the main() function to create an object and call the functions accordingly to enable the task. [10]

Question 6.
class PrintPrime has been defined to find the prime numbers from a list of data. Some of the members of class are given below :
Class name : PrintPrime
Data members/instance variables : limit : integer to store the limit.
arr[ ] : integer array of maximum size 150.
3
Member functions/methods :
PrintPrime( ) : constructor to assign 0 to limit and arr[ ].
void readList( ) : to accept the limit and input the array arr[ ] upto the limit.
int IsPrime(int num,int y) : using recursive method check num is prime or not. If prime then the function returns 1,
otherwise 0.
void PrintPrimes( ) : to read integers from the array arr[ ] and print only prime Integers by invoking recursive function int
IsPrime( ) up to the given limit. Specify the class PrintPrime giving the details of the constructor and all functions. The main( )
function needs to be written. [10]

SECTION-C
Question 7.
A class Personal contains employee details and another class Retire calculates the employee’s Provident Fund and
Gratuity. The details of the two classes are given below:
Class Name : Personal
Data Members:
Name : stores the employee name
basic_pay : stores the employee basic salary (in decimals)
acc_no : stores the employee bank account number
Member functions:
Personal( …. ) : parameterized constructor to assign value to data members
void display( ) : to display the employee details
Class name : Retire
Data Members:
Yrs : stores the employee years of service
Pf : stores the employee provident fund amount ( in decimals )
Grat : stores the employee gratuity amount ( in decimals )
Member functions:
Retire ( …. ) : parameterized constructor to assign value to data members of both the classes.
void provident( ) : calculates the PF as (2% of the basic pay) * years of service.
void gratuity( ) : calculates the gratuity as 12 months salary, if the years of service is more than or equal to 10
years else the gratuity amount is nil.
void display1( ) : Displays the employee details along with the PF (Provident Fund ) and gratuity amount.
Specify the class Personal giving details of the constructor and member functions void display( ).
Using the concept of inheritance, specify the class Retire giving details of constructor, and the
member functions void provident( ), void gratuity( ) and the void display1( ).
The main function need not be written. [5]

Question 8.

i) Write the pre and post order tree traversal [2]


ii) Name the leaves of the tree [1]
iii) Height of the tree [1]
iv) Root of the tree [1]

You might also like