March Test1 Xiia
March Test1 Xiia
March Test1 Xiia
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 [ ].
---------------------------------------------------------------------------------------------------------------------
Question 1.
(i) Among the following which one is Associative law:- [1]
(a) X(YZ) =(XY)Z
(b) X+(YZ)=(X+Y)(X+Z)
(c) (X+Y).Z=XZ+YZ
(d) XYZ=(XY)Z
(ii) Assertion (A):- P = 20 is greater than 10, Q= JUNE comes after May . [1]
These two statements are consistent.
Question 2.
(a) Convert the following infix notation to prefix form. [2]
( A / B + C ) / ( D * ( E − F ))
(b) A matrix A[m][m] is stored in the memory with each element requiring 4 bytes [2]
of storage If the base address at A[1]{1] is 1500 and the address of A[4][5] is
1608 ,determine the order of the matrix when it is stored column major wise.
(c) The following function check() is part of some class.What will the function [3]
check() return when both ‘m’ and ‘n’ are equal to 5.
int check(int m,int n)
{
if (n==1)
return -m--;
else
return ++m+check(m,--n);
}
(d) Following is a recursive function to find the sum of the digits from a string .Fill [3]
up the blanks with necessary statements.
int sum(String str)
{
?1? {
char c=str.charAt(0);
if (c>='0' && c<='9')
return ?2?;
else
return sum(str.substring(1));
}
else ?3?
SECTION - A
Answer any two questions.
Question 3.
(i) For the selection in national level competition ,the selection committee has [5]
decided to select few candidates who satisfies one of the following conditions:-
● The candidate is a female and not below 18 years of age and has won
prize at state level
● The candidate is a male of 18 years or above and has won the prize at state
level.
● The candidate is a male who is a member of racing organizations and also
national level player.
● The candidate is a female who has qualified in inter_school racing
competition of a state.
Draw the truth table for the above phenomenon and the logic circuit diagram of
the reduced expression.
Inputs
A The candidate is male( 1 indicates yes and 0 indicates no)
B The candidate is 18 years and above(1 indicates yes and 0
indicates no)
C The candidate belongs to the racing organization or/and
national level player (1 indicates yes and 0 indicates no)
D The candidate is an inter school state champion or state prize
winner (1 indicates yes and 0 indicates no)
(ii) Reduce the above expression X (A,B,C,D) by using 4-variable Karnaugh map, [5]
showing the various groups (i.e. octal, quads and pairs). Draw the logic gate
diagram for the reduced expression. Assume that the variables and their
complements are available as inputs.
Question 4.
(i)(a) Given the boolean function F(A,B,C,D) = 𝚷(0,8,10,12,13,14,15) [4]
Reduce the above expression by using 4 variable K map ,showing the various
groups (i.e. octets,quads and pairs).
(b) Draw the logic gate diagram for the reduced expression. Assume that the [1]
variables and their complements are available as inputs. [
(ii)(a) [4+1]
From the above logic circuit,the diagram mentions the output at (1) ,(2),(3) and
also the output at (4) and simplifies it.
Identify the logic gate which is equivalent to the simplified expression
Question 5.
With the help of 2 half adder and an OR gate make a FULL adder [5]
Draw the logic circuit corresponding to it.After writing the Truth table of a Full
adder Write the POS expression of carry from the truth table.
(ii) Verify if the following proposition is valid using the truth table: A => ( B ∧ C ) [3]
= ( A => B ) ∧ ( B => C )
(iii) How is a 2 to 4 decoder related to 4:1 multiplexer? [2]
SECTION – B
Answer any two questions
Each program should be written in such a way so 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 6.
A class Strop is used to find the sum of positional values of the words of a sentence
.all the words are in capital letter.eg if the word is VAT
Sum of positional values=22+1+20=(2+2)+1+(2+0)=7
Data member
Member functions
Question 7.
Consider a class Arrop which is used to find the player’s name and the name of the games he
can play. One player can be capable of playing different games. As example if players and games
are as follows:
A cricket
B football
A basketball
C cricket
Program should display
A capable of playing cricket and basketball
B capable of playing football
C capable of playing cricket
Data member
String game[] Array to store the name of the game which the student
can play.
void readdata() To store the names of the players and the name of the
game he or she can play in player[] and game[]
respectively.
void display() Display the name of the players along with name of
the game which he can play as mentioned in the
example
Question 8.
A Class Decihexa is used for finding out how many alphabets are present in an
hexadecimal number
Example : 3A contains 1 alphabet
756 contains no alphabet
A class is designed for following purpose:
Data members
Member functions:
Decihexa() default constructor to initialize the
data member with legal initial value
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 9.
Shelf is a kind of data structure which can store elements with the restriction that an element
can be added from the rear end and removed from the front end only.
shelf(int n ) : void display( ) : to display the constructor to initialize lim=n, front= 0 and
elements of the shelf rear=0
Data members
Member functions:
Assume that the super class Circle has been defined. Using the concept of inheritance,
specify the class Volume giving the details of the constructor(...), double calculate( )
and
void display( ).
The super class, main function and algorithm need NOT be written.
Question 11.
(i ) Find the Big-O Complexity of the following nested loop. [3]
for(i=0;i<N;i++)
{
for (j=i+1;j<N;j++)
{
Sequence of statements
}
}
(ii) Answer the following question s for the binary tree given below:- [2]