Computer Science Paper 1
Computer Science Paper 1
Computer Science Paper 1
PAPER 1
(THEORY)
(Maximum Marks: 70)
(Time allowed: 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 six 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 (20 Marks)
Answer all questions.
While answering questions in this Part, indicate briefly your working and reasoning,
wherever required.
Question 1
(a) State Associative law and prove it with the help of a truth table. [1]
(b) Draw the truth table to prove the proportional logic expression. [1]
(X => Y) ʌ (Y => X) = X <=> Y
(c) Find the dual for the Boolean equation: AB’ + BC’ + 1 = 1. [1]
(d) Convert the Boolean expression F(X,Y,Z) = X’Y’Z + X’YZ’ + XYZ into its [1]
cardinal form.
Question 2
(a) Differentiate between Stack data structure and Queue data structure. [2]
-----------------------------------------------------------------------------------------------------------------------------------
1
(e) Define Big ‘O’ notation. State the two factors which determine the complexity of an [2]
algorithm.
Question 3
The following is a function of some class. What will be the output of the function test ( ) [5]
when the value of count is equal to 4 ? Show the dry run / working.
}
}
-----------------------------------------------------------------------------------------------------------------------------------
2
(a) Given the Boolean function F(A, B, C, D) = ( 0, 2, 3, 6, 8, 10, 11, 14, 15 )
(i) Reduce the above expression by using 4-variable Karnaugh map, showing the [4]
various groups (i.e. octal, quads and pairs).
(ii) Draw the logic gate diagram for the reduced expression. Assume that the [1]
variables and their complements are available as inputs.
(b) Given the Boolean function F(P,Q,R,S) = π ( 5, 7, 8, 10, 12, 14, 15 )
(i) Reduce the above expression by using 4-variable Karnaugh map, showing the [4]
various groups (i.e. octal, quads and pairs).
(ii) Draw the logic gate diagram for the reduced expression. Assume that the [1]
variables and their complements are available as inputs.
Question 5
(a) Draw the logic diagram and truth table to encode the decimal numbers ( 2, 3, 5, 7, 8 ) [5]
and briefly explain its working
(b) Simplify the following Boolean expression and draw the gate for the reduced [3]
expression:
F= A’B + AB’C + A
(c) Define Universal gates. Give one example and show how it works as an OR gate. [2]
Question 6
(a) Draw a truth table with a 3 input combination which outputs 1 if there are odd [5]
number of 0’s. Also derive an SOP expression for the output. Reduce the expression
using Karnaugh Map.
(b) Define Proposition. How does tautology differ from contradiction? [3]
-----------------------------------------------------------------------------------------------------------------------------------
3
Question 7
A class Composite contains a two dimensional array of order [m x n]. The maximum value [10]
possible for both ‘m’ and ‘n’ is 20. Design a class Composite to fill the array with the first (m x n)
composite numbers in column wise. The details of the members of the class are given below:
Composite
Class name :
Member functions/methods:
Composite(int mm, int nn ) : to initialize the size of the matrix m=mm and n=nn
void fill ( ) : to fill the elements of the array with the first (m × n)
composite numbers in column wise
Specify the class Composite giving details of the constructor(int,int), int isComposite(int), void
fill( ) and void display( ). Define a main( ) function to create an object and call the functions
accordingly to enable the task.
-----------------------------------------------------------------------------------------------------------------------------------
4
Methods/Member functions:
Specify the class Sort giving details of the constructor, void readword( ), void arrange( )
and void display( ). Define the main( ) function to create an object and call the functions
accordingly to enable the task
-----------------------------------------------------------------------------------------------------------------------------------
5
A Special number is a number in which the sum of the factorial of its digits is equal to the [10]
number.
Example: 145 ( 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:
Member functions/methods:
Specify the class Special, giving details of the Constructor, void read( ), int factorial(int),
boolean isSpecial( ) and void display( ). Define the main() function to create an object and
call the member function according to enable the task.
-----------------------------------------------------------------------------------------------------------------------------------
6
Question 10
An interface Shape is defined with a method area() which returns the area of the [5]
implementing shape.
Create the classes Circle and Rectangle which implement the interface Shape. These classes
have attributes which reflect their dimensions (radius for a circle, height and width for a
rectangle) which are set by their constructors.
The details of the members of the interface and both the classes are given below:
-----------------------------------------------------------------------------------------------------------------------------------
7
Circular Queue is a linear data structure in which the operations are performed based on [5]
FIFO (First In First Out) principle and the last position is connected back to the first
position to make a circle.
Specify the class Cqueue giving the details of void insert(int) and int delete( ). Assume
that the other functions have been defined.
-----------------------------------------------------------------------------------------------------------------------------------
8
(b) Answer the following questions from the diagram of a Binary Tree given below:
(i) Name the Root and the leaves of the tree. [1]
(iii) Separate the Internal nodes and the External nodes of the tree. [1]
-----------------------------------------------------------------------------------------------------------------------------------
9