Class Xii Paper
Class Xii Paper
Class Xii Paper
COMPUTER SCIENCE
Paper – 1
(THEORY)
Three hours
(Candidates are allowed additional 15 minutes for only reading the paper.
They must NOT start writing during this time)
----------------------------------------------------------------------------------------------------------------------------------
Answer all questions in Part I (compulsory) and seven questions from Part-II, choosing three 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
While answering questions in this Part, indicate briefly your working and reasoning,
wherever required.
Question 1
(a) State and verify distributive law using the truth table. [2]
(b) Why NAND gate is regarded as the universal gate? Draw the logic gate symbol and make [2]
the truth table for the two input NAND gate.
(c) Find the complement of F (a, b, c, d) using De Morgan’s laws. Show the relevant reasoning. [2]
F(a, b, c, d) = a + {(b + c).(b’ + d’)}.
(d) Simplify using law of Boolean algebra. At each step state clearly the laws used for [2]
simplifications. F = x.y + x.z + x.y.z
(e) Given the Boolean function F(x, y, z) = ∑(0, 2, 4, 5, 6). Reduce it using Karnaugh’s map. [2]
Question 2
(d) Each element of an array D[-15….20, 20….45] requires 2 bytes of storage. If the array [2]
is stored in column major form and the base address of D[0][0] is 1200, Determine
the location of D[1][40].
(f) Convert the following infix notation to its postfix form: [2]
A-B/(C^D)+(M*N)
(a) The following functions show() and calling() are parts of some class. Assume that the
parameter n is greater than 1 when the function is invoked. It returns value 1 when true
otherwise returns 0.
Show the dry run/working.
void calling()
{
int f = 2;
show(n, f);
}
(i) What will the function show() returns when calling() is invoked with n = 11? [2]
(ii) What will the function show() returns when calling() is invoked with n = 27? [2]
(iii) In one line, state what the function show() is doing, apart from recursion. [1]
(b) The following is a function of some class. It returns 1 if the number is a perfect number
otherwise it returns 0.
/* A perfect number is a number which is equal to the sum of its factors other than the number
itself.*/
int PerfectNo (int n)
{
int?1?
for(int j=1;?2?;j++)
{
if(?3?)
sum?4?;
}
if(?5?)
return1;
else
return 0;
}
BSP003 © www.javaforschool.com
JAVA FOR SCHOOL SAMPLE PAPER 3
Making Java Fun To Learn ISC (Class XII)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PART – II
Answer seven questions in this part, choosing three questions from
Section A, two from Section B and two from Section C.
SECTION - A
Answer any three questions
Question 4
(b) Given the Boolean function: F (A,B,C,D) = π ( 3, 4, 6, 7, 11, 12, 13, 14, 15 )
(i) Reduce the above expression by using 4 - variable K-Map , showing the various [4]
groups (i.e; octal , quads and pairs).
(ii) Draw the Logic gate diagram of the reduced expression. Assume that the variable
and their complements are available as inputs. [1]
Question 5
For the selection in national level racing competition the selection committee has decided to select few
candidates who satisfies at least one of the following conditions:
The candidate is a female not below 18 years of age and has won prize at the state level.
The candidate is a male of 18 years or above and has won the prize at the state level.
The candidate is a male who is a member of racing organization and also National level player.
The candidate is a female who has qualified in inter-school racing competition of a state.
OUTPUT IS:
S : The candidate is selected [1 indicates she is selected and 0 indicates she is rejected]
(a) Draw the truth table for the inputs and outputs given above and write the SOP expression [5]
for S (A, B, C, D).
(b) Reduce S (A, B, C, D) using Karnaugh’s map. [5]
Draw the logic gate diagram for the reduced SOP expression for S (A, B, C, D).
You may use gates with two or more inputs. Assume that variable and their complements are
available as inputs.
Question 6
(a) Draw a logic diagram for the following function using only NOR gates: [3]
F(A, B, C) = (A’ + B’) . (B + C’)
(b) Convert the following expression into canonical Sum-Of-Product form: [3]
F(X, Y, Z) = X’.Y + X’.Y’ + Y.Z’
(c) From the logic circuit diagram given below, name the outputs (1), (2) and (3). Finally [4]
derive the Boolean expression and simplify it.
Name and draw the logic gate.
X (1)
Y (3) F (X,Y,Z)
(2)
Question 7
(a) Draw the truth table to prove the following proportional logic expression:
A <=> B = (A <=> B) ^ (B => A) [3]
(b) State a difference between a Tautology and Contradiction. [2]
(c) Draw the truth table and a logic gate diagram of Hexa-Decimal to Binary Encoder. [5]
BSP003 © www.javaforschool.com
JAVA FOR SCHOOL SAMPLE PAPER 3
Making Java Fun To Learn ISC (Class XII)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SECTION - B
Answer any 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.
Question 8 [10]
A class called LCM has been defined to find the LCM of two integers. Some of the members of the
class LCM are given below:
Specify the class LCM, giving details of the two Constructor and functions void acceptData(),
int getLCM() and void printData(). Also write the main( ) function to create an object and call
the member function accordingly.
Question 9 [10]
Member functions/methods :
Angle( ) : constructor to assign 0 to deg and min.
void inputAngle() : to input values of deg and min.
void dispAngle() : to print the values of deg and min with proper message.
Angle sumAngle(Angle A, Angle B) : to find and return the sum of angles from objects A and B
by using the above technique of adding angles
Specify the class Angle giving the details of the constructors and all the functions. You need not write
the main function.
Question 10 [10]
Write a Java program to input a sentence from the user in lowercase and capitalizes the first character
of every word present in it.
Member functions:
Capitalize() : default constructor
void inpSentence() : to input the sentence
void capChar() : capitalizes the first character of every word and form
a new sentence 'cap'
void display() : display the original sentence along with the new
changed sentence.
Specify the class Capitalize giving details of the constructor Capitalize(), void inpSentence(), void
capChar() and void display(). Define the main() function to create an object and call the function
accordingly to enable the task.
BSP003 © www.javaforschool.com
JAVA FOR SCHOOL SAMPLE PAPER 3
Making Java Fun To Learn ISC (Class XII)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SECTION - C
Answer any two questions.
Each program/ Algorithm 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 pseudo codes.
(Flowcharts are not required.)
The Programs must be written in Java.
The Algorithm must be written in general/standard form, wherever required.
Question 11 [10]
A class Student defines the personal data of a student while another class Marks defines to the
roll number, name of subject and marks obtained by the student. The details of classes are as:
Member functions/methods :
Member functions/methods :
Specify the class Student giving the details of the constructor, functions void inputDetails() and
void show(). Using the concept of inheritance, specify the class Marks giving the details of the
functions void readDetails(), int point() and void show( ) function. You do not need to write the
main() function.
Question 12 [10]
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 details of the class Repeat is given below:
Class name : Repeat
Data members/ instance variables :
Member functions/methods :
void pushvalue(int v) : to add integers from the rear index if possible else
display a message ("Overflow")
int popvalue() : to remove and return element from front if possible
otherwise returns -9999
void disp() : Displays the elements present in the list. If the array is
empty then display a message ("Underflow")
(a) Specify the class Repeat giving details of the constructor() and functions void pushvalue(int),
int popvalue() and void disp(). The main() function and algorithm need not be written.
(b) What is the common name of the entity described above?
(c) On what principle does this entity work?
Question 13
(a) A linked list is formed from the objects of the class, [4]
class Node
{
int item;
Node next;
}
Write an Algorithm OR a Method to search for a value in a linked list.
(b) Discuss with the help of an example why O(N2) complexity is better than O(2N)? [2]
BSP003 © www.javaforschool.com
JAVA FOR SCHOOL SAMPLE PAPER 3
Making Java Fun To Learn ISC (Class XII)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(c) Answer the questions below for the given binary tree: [4]
B C
D E G
F I J
K
H
L