0% found this document useful (0 votes)
6 views8 pages

Selfstudys Com File

This document outlines the structure and requirements for a Computer Science Theory Paper, including instructions for answering questions, the distribution of marks, and the topics covered in various sections. It consists of two parts: Part I, which is compulsory and worth 20 marks, and Part II, which requires answering six questions from three sections, totaling 50 marks. The questions cover topics such as Boolean algebra, data structures, programming in Java, and algorithm design.

Uploaded by

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

Selfstudys Com File

This document outlines the structure and requirements for a Computer Science Theory Paper, including instructions for answering questions, the distribution of marks, and the topics covered in various sections. It consists of two parts: Part I, which is compulsory and worth 20 marks, and Part II, which requires answering six questions from three sections, totaling 50 marks. The questions cover topics such as Boolean algebra, data structures, programming in Java, and algorithm design.

Uploaded by

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

COMPUTER SCIENCE

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 the properties of zero in Boolean algebra. [1]
(b) Find the complement of the following Boolean expression using [1]
De Morgan’s law:
F(P,Q,R) = P + (Q  R)
(c) Find the dual of: (A + 0)  (B + 1) = A [1]
(d) State whether the following proposition is a tautology, contradiction or a [1]
contingency:
F = (P => Q) V (Q => ~P)
(e) Study the diagram given below and answer the questions that follow: [1]

A•
X
B•

(i) Name the basic gate which is represented by the diagram.


(ii) What will be the value of X when A=1 and B=0 ?
Question 2

(a) State the difference between a Binary Tree structure and a single Linked List. [2]
(b) A matrix B[10][20] is stored in the memory with each element requiring 2 bytes of [2]
storage. If the base address at B[2][1] is 2140, find the address of B[5][4] when the
matrix is stored in Column Major Wise.
(c) Convert the following infix notation to prefix form: [2]
(X + Y) / (Z * W / V)
(d) State the best case and the worst case complexity for bubble sort algorithm. [2]
(e) What is the significance of the keyword ‘new’ in Java? Mention the areas where it [2]
is used.

Question 3

The following function check( ) is a part of some class. What will the function check( ) [5]
return when the value of (i) n=25 and (ii) n=10. Show the dry run/ working.

int check(int n)
{ if(n<=1)
return 1;
if( n%2==0)
return 1 + check(n/2);
else
return 1 + check(n/2 + 1);
}

PART – II (50 Marks)


Answer six questions in this part, choosing two questions from
Section A, two from Section B and two from Section C.
SECTION - A
Answer any two questions.

Question 4

(a) Given the Boolean function: F(A,B,C,D) = Ʃ (0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13,14).
(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(A, B, C, D) = 𝝅 ( 3, 4, 6, 9, 11, 12, 13, 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 circuit diagram for an octal to binary encoder and explain its working [5]
when a particular digit is pressed. Also, state the difference between encoders and
decoders.
(b) Draw the circuit of a two input XOR gate with the help of NOR gates. [3]
(c) Convert the following expression to its cardinal SOP form: [2]
F(P,Q,R) = PQR + PQR + PQR + PQR

Question 6
(a) A company intends to develop a device to show the high status power load for a [5]
household invertor depending on the criteria given below:
• If Air conditioner and Geyser are on
OR
• If Air conditioner is off, but Geyser and Refrigerator are on
OR
• If Geyser is off, but Air conditioner and Water purifier are on
OR
• When all are on
The inputs are:
INPUTS
A Air conditioner is on
G Geyser is on
R Refrigerator is on
W Water purifier is on
(In all the above cases 1 indicates yes and 0 indicates no.)
Output : X [1 indicates high power, 0 indicates low power for all cases]
Draw the truth table for the inputs and outputs given above and write the SOP
expression for X(A,G,R,W).
(b) Draw the truth table and derive an SOP expression for sum and carry for a full adder. [3]
Also, draw the logic circuit for the carry of a full adder.
(c) Simplify the following expression using Boolean laws: [2]
F = [ (X + Y)  (Y + Z) ] + (X + Z)
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 7
Design a class Convert to find the date and the month from a given day number for a [10]
particular year.
Example: If day number is 64 and the year is 2020, then the corresponding date would be:
March 4, 2020 i.e. (31 + 29 + 4 = 64)
Some of the members of the class are given below:
Class name : Convert
Data members/instance variables:
n : integer to store the day number
d : integer to store the day of the month (date)
m integer to store the month
y : integer to store the year
Methods/Member functions:
Convert ( ) : constructor to initialize the data members with
legal initial values
void accept( ) : to accept the day number and the year
void day_to_date( ) : converts the day number to its corresponding
date for a particular year and stores the date in
‘d’ and the month in ‘m’
void display( ) : displays the month name, date and year
Specify the class Convert giving details of the constructor( ), void accept( ),
void day_to_date( ) and void display( ). Define a main( ) function to create an object
and call the functions accordingly to enable the task.

Question 8
Design a class BinSearch to search for a particular value in an array. [10]

Some of the members of the class are given below:


Class name : BinSearch
Data members/instance variables:
arr[ ] : to store integer elements
n : integer to store the size of the array
Member functions/methods:
BinSearch(int nn ) : parameterized constructor to initialize n=nn
void fillarray( ) : to enter elements in the array

void sort( ) : sorts the array elements in ascending order using


any standard sorting technique
int bin_search(int l,int u,int v) : searches for the value ‘v’ using binary search
and recursive technique and returns its location
if found otherwise returns -1
Define the class BinSearch giving details of the constructor( ), void fillarray( ),
void sort( ) and int bin_search(int,int,int). Define the main( ) function to create an object
and call the functions accordingly to enable the task.

Question 9

A class Mix has been defined to mix two words, character by character, in the following [10]
manner:
The first character of the first word is followed by the first character of the second word and
so on. If the words are of different length, the remaining characters of the longer word are
put at the end.
Example: If the First word is “JUMP” and the second word is “STROLL”, then the required
word will be “JSUTMRPOLL”

Some of the members of the class are given below:


Class name : Mix
Data member/instance variable:
wrd : to store a word
len : to store the length of the word
Member functions/methods:
Mix( ) : default constructor to initialize the data
members with legal initial values
void feedword( ) : to accept the word in UPPER case
void mix_word( Mix P, Mix Q ) : mixes the words of objects P and Q as stated
above and stores the resultant word in the
current object
void display( ) : displays the word

Specify the class Mix giving the details of the constructor( ), void feedword( ), void
mix_word( Mix, Mix ) and void display( ). Define the main( ) function to create objects
and call the functions accordingly to enable the task.
SECTION – C
Answer any two questions.
Each program should be written in such a way that it clearly depicts the logic of the problem
stepwise.
This can be achieved by using comments in the program and mnemonic names or pseudo codes
for algorithms. The programs must be written in Java and the algorithms must be written in
general / standard form, wherever required / specified.
(Flowcharts are not required.)

Question 10
A Circular queue is a linear data structure which works on the principle of FIFO,
enables the user to enter data from the rear end and remove data from the front end
with the rear end connected to the front end to form a circular pattern. Define a class
CirQueue with the following details:
Class name : CirQueue
Data members / instance variables:
cq[ ] : array to store the integers
cap : stores the maximum capacity of the
array
front : to point the index of the front end
rear : to point the index of the rear end
Member functions:
CirQueue (int max) : constructor to initialize the data
member cap=max, front=0 and
rear=0
void push(int n) : to add integer in the queue from the
rear end if possible, otherwise
display the message “QUEUE IS
FULL”
int pop( ) : removes and returns the integer
from the front end of the queue if
any, else returns -9999
void show( ) : displays the queue elements

(a) Specify the class CirQueue giving details of the functions void push(int) and [4]
int pop( ). Assume that the other functions have been defined.
The main function and algorithm need NOT be written.

(b) How is a linear queue structure different from a circular queue structure? [1]
Question 11
An interface Data is defined with a data member and a method volume( ) which returns the [5]
volume of the implementing shape. A super class Base has been defined to contain the radius
of a geometrical shape. Define a sub class CalVol which uses the properties of the interface
Data and the class Base and calculates the volume of a cylinder.
The details of the members of the interface and both the classes are given below:
Interface name : Data
Data member:
double pi : initialize pi = 3.142
Member functions/methods:
double volume( ) :
Class name: Base
Data member/instance variable:
rad : to store the radius in decimal
Member functions/methods:
Base(…) : parameterized constructor to initialize the data
member
void show( ) : displays the radius with an appropriate message
Class name: CalVol
Data member/instance variable:
ht : to store the height in decimal
Member functions/methods:
CalVol(…) : parameterized constructor to initialize the data
members of both the classes
double volume( ) : calculates the volume of a sphere by using the
formula ( pi x radius2 x height )
void show( ) : displays the data members of both the classes
and the volume of the sphere with appropriate
message
Assume that the interface Data and the super class Base has been defined. Using the concept
of inheritance, specify the class CalVol giving the details of the constructor(…), double
volume( ) and void show( ).
The interface, super class, main function and algorithm need NOT be written.
Question 12
(a) A linked list is formed from the objects of the class Node. The class structure of the [2]
Node is given below:
class Node
{
int n;
Node next;
}
Write an Algorithm OR a Method to find the product of the integer numbers from an
existing linked list.
The method declaration is as follows:
void Product_Node( Node str )

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

F C

G H B

I D E J

(i) Write the post-order traversal of the left subtree of the above structure. [1]
(ii) State the degree of the Nodes E and H. [1]
(iii) Mention the external nodes of the right subtree. [1]

You might also like