Unsolved CTS 2024
Unsolved CTS 2024
(a) What willthe output of Try() when the value of chl={(P, LA, Y)and x=1?
(2]
(b) What will the output of Try1( )when the value of n="SKY"?
(1]
(iv) The following function is a part of some class which computes and returns the value of a number p'
raised to the power 'q'
(pg). There are some places in the code marked by ?1?,?2?,?3? which must be replaced by an
that the function works correctly. expression / a statement so
else
}
(a) What is the expression or statement at ?1?
(b) What is the expression or statement at ?2? (1]
(c) What is the expression or statement at ?3? (1]
[1]
PART II- 50 MARKS
Answer six questions in this port, choosing two questions from Section A, two from Section Band two from SectionC.
SECTION-A
Answer any two questions.
Question 3.
() AFootballAssociation coach analyses the criteria for a win/draw of his team depending on the folowing conditions.
If the Centre and Forward players perform well but Defenders do not perform well.
OR
If Goalkeeper and Defenders perform well but the Centre players do not perform well.
OR
If all perform well.
The inputs are:
INPUTS
C Centre players perform well
D
Defenders perform well
Forward players perform well
G Goalkeeper perform well
(in all the above cases, 1 indicates yes and Oindicates no.)
Output: X- Denotes the win/draw criteria [1 indicates win/draw and Oindicates defeat in all cases]
Draw the truth table for the inputs and outputs given above and write the SOP expression for X(C, D, F, G).
(5)
(i) Reduce the above expression X(C, D, F, G) by using 4-variable Karnaugh map, showing the various groups (i.e.
pairs).
octal, quads and
Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as
inputs.
[S)
Question 4.
(i) (a) Reduce the Boolean function F(A,B,C,D) = n (0, 1, 2, 3, 4, 6, 9, 11, 13) by
using 4-variable Karnaugh map, showing the
various groups (i.e. octal, quads and pairs). |4)
(b) Draw the logic gate diagram for the reduced expression. Assume that the variables and
their complements are available
as inputs.
(1]
(üi) (a) From the logic circuit diagram given below, name the outputs (1), (2)and (3) and finally derive the
and simplify it. ldentify the propositionalconnective which is equivalent to the simplified Boolean expression (F)
Boolean expression. [4)
X
f(X,Y,Z)
D (2)
(b) If A=land B-0 then find the value of (A' + 1) " B [1]
Question5.
() Draw the logic circuit to encode the following Hexadecimal number
(1,3, 5,6,9, A, C, E) to its binary equivalents. Also state the binary equivalents of the given numbers. (5)
Output Onstotatoun
SECTION C
Answer any two questions.
logic of the problem stepwise.
Eoch program should be written in such a way that it clearly depicts the
mnemonic names or pseudo codes for algorithms.
This con be achieved by using comments in the program and required/specified.
written in general/standard form, wherever
The programs must be written in Java and the algorith ms must be
(Flowcharts are not required.)
Question 9
added from the rear end and
elements with the restriction that an element can be
Shelf is a kind of data structure which can store
removed from the front end only.
The detaiis of the class Shelf are given below:
: Shelf
Class name
Oata members/instance variables:
array to hold decimalnumbers
elel )
: maximum limit of the shelf
to point the index of the front end
front
:to point the index of the rear end
fear
Methods/Member functions
constructor to initialise rear-0, limn, front 0 and
Sheiffint n) possible. otherwise
void pusthValfdouble vi
:to push decimal numbers in the shelfat the rearend if
display the message "SHELE S FULL"
trom the front endot the shelt
to remove and return the decimal number
double popVall)
if any, else returns -999 99
shelt
: to display the elements of the
other functions
pushval(double) and 14}] doubie popVall ) Assume that the
void display)
details of the funtions void
( Specity the class Shelfgiving
have been defined
be written
The main )function and algoithen need NOT
() Nare the entity described above and state its principle.
Question 11.
(i) With the help of an example, briefly explain the constant factor in time complexity.
(2]
(üi) Answer the following questions from the diagram of a Binary Tree given below:
A
E H
(a) Name the external nodes of the right sub tree. [1]
(b) State the size and depth of the tree. (1]
(c) Write the post-order traversal of the above tree structure. [1]