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 [ ].
Answer all questions
a) Draw the truth table of implication.
b) Explain bit and byte.
c) What is the use of ASCII code?
d) What is BCD?
e) What is a proposition?
Question 2 [5X2=10]
a) Write the dual of the following. A.(A’+0)=1
Write the complement of the following: (A+BC).(A’B+C’)
b) State the Associative law and prove it with the truth table.
c) Explain Disjunction with example.
d) Explain contradiction with example.
e) Write the inverse and converse of the following proposition.
Proposition: “If four is an even number, then it is divisible by 2”
Question 3 
The following function wit() is a part of a class. What will be the output of the following function wit() when the value of n is ‘JAVA ‘ and the value of R is 3? Show the dry run/working.
void wit(String n, int p)
System.out.print(“ “ );
System.out.print (n.charAt(p) +” .”);
System.out.print (n.charAt(p) +” – ”);
Attempt any two questions from Section-A, two from Section-B and two from Section-C
Question 4 Perform the following conversions. [5X2=10]
c) 1010-101(using 2s complement method)
e) 11111 X 101
A person is allowed to travel in a reserved coach of the train, if he / she satisfies the criteria given below:-
• The person has a valid reservation ticket and a valid ID proof.
• The person does not have a valid reservation ticket, but holds a valid pass issued by the Railway department with a valid ID proof.
• The person is a disabled person and holds a valid pass issued by the Railway department along with a valid ID proof.
The inputs are:
R The person has a valid reservation ticket
P The person holds a valid pass issued by the
D The person has a valid ID proof
H The person is a disabled person
(In all the above cases 1 indicates yes and 0 indicates no).
Output :- T Denotes allowed to travel ( 1 indicates yes and 0 indicates no in all the cases)
Draw the truth table for the inputs and outputs given above and write the terms with conjunction operator for the terms that are true(1’s) in the result column. 
a) Simplify the following expression.
b) Draw the truth table and circuit of EX-OR gate 
a) Draw the combinational logic circuit and truth table of full adder. 
b) Verify if
(P’Q)^P=(P^Q’)v(P^ Q) with the help of truth table. 
c) Draw the logic circuit diagram with NAND gate 
Answer 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 Change to perform string related operations. The details of the class are given below:
Class name : Change
str : stores the word
newstr : stores the changed word
len : stores the length of the word
Change() : default constructor
void inputword() : to accept a word
char caseconvert(char ch) : converts the case of the character and returns it
void recchange(int) : extracts characters and changes its case using caseconvert() and
forms a new word
void display() : displays both the words
Specify the class Change, giving details of the constructor(), member functions void inputword(), char caseconvert(char ch), void recchange(int) and void display(). Define the main function to create an object and call the functions accordingly to enable the above change in the given word.
A class RevArray contains a two dimensional integer array of order [ m x n]. The maximum value possible for both ‘m’ and ‘n’ is 12. Design a class RevArray to reverse all the elements of the f a given matrix. The details of the members of the class are given below :
Class name : RevArray
arr : stores the matrix elements
rev : stores the reverse of the matrix elements
m : integer to store the number of rows
n : integer to store the number of columns
Member functions :
RevArray () : default constructor
RevArray (int mm, int nn) : to initialize the size of the matrix, m=mm, n=nn
void fillaray() : to enter the elements of the matrix
void reverse( ) : to reverse all the elements of a given matrix and
store in rev.
void disparray() : displays both the arrays in a matrix form
Specify the class RevArray giving the details of the constructor and other member functions.
Write the main function and call the functions.
A Special number is a number in which the sum of the factorial of its digits is equal to the number. Example 1445 ( 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:
Class name : Special
n : integer to store the number
Special() : default constructor
void read() : to accept the number
int factorial(int x) : return the factorial of a number using recursion technique
booleanisSpecial() : checks for the special number by invoking the function factorial() and returns true if Special, otherwise returns false.
void display() : to show the result with an appropriate message
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. [ 10 ]
Answer any two questions
a) Write a recursive method to calculate and return the sum of the digits of a number. The function signature is as follows.
int sumofdigits(int num) 
b) Differentiate constructor and method. 
a) Draw all four realization of NAND and NOR gate. 
b) What is the function overloading? 
Question 12. 
A class stringop is designed to handle string related operations. Some members of the class are given below:
txt : to store the given string of maximum length 100. Member function
stringop() : constructor
void readstring() : to accept the string
char caseconvert(int, int): to convert the letter to other case
void circular decode() : to decode the string by replacing each letter by converting it to opposite case and then by the next character in a circular way. Hence “AbZ” will decode “bCa”.
Specify the class giving details of all member functions . You do not need to write function main().