Saturday, February 18, 2017

ISC computer Science class XII sample paper 6


ISC computer science class XII sample paper 6


Answer all questions in Part I (compulsory) and seven 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

Answer all questions

Question 1.                                                                                                       [1X5=5]
A) Draw the truth table to prove the proportional logic expression.
a<=>b  =  (a => b) . (b => a)
B) Reduce the following 3 input function into its simplest form                                                 
F(X,Y,Z)= Σ(0,1,3,5)
C) Given, F (X, Y, Z) = (X+Y). (Y+Z) write the function in canonical product-of-sum form.                             
D) Convert the following expression F(X, Y, Z)=XY+Y’Z into minterms.
E) Simplify the following expression using law of Boolean algebra. At each step clearly state the law used for simplification.  xy + xz + xyz
Question 2.                                                                                              [2 x 5 =10]
a) Define a Queue. How is dequeue is different from queue
b) Convert the following infix notation to postfix:
 A+[(B+C)+(D+E)* F]/G
c) State the differences between a constructor and a function.
d) For an array of real numbers x [6][20], find the address of x [5] [4 ], if x [0] [0] is stored in location 100 in the column major order. Assume that each element requires 4 bytes.
e) What do you mean by time and space complexity?
                                                                                                                                               
Question3.
Give output of the following function where a and b are arguments greater than 0. Show the dry run/working.
int first(int a , int b)
{
Int ans, sm,la;
If(a<b)
{ sm=a;
la=b;
}
else
{
sm=b;
la=a;
}
ans=la;
while(ans%sum!=0)
ans+=la;
return ans;
}
(i)     What will the function first (7,5) return ?                                                                            [2]
(ii)    What will the function first (6,8) return ?                                                                            [2]
(iii)   In one line, state what the function is doing.                                                                     [1]

Part II
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 F(P,Q,R,S)= Σ(0,1,2,3,5,6,7,10,13,14,15)
i) Reduce the above expression by using 4 variable Karnaugh map, showing the various groups( i.e. octal, quads and pairs).                                                                                                                        [4 ]
ii) Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs.                                                                                                      [1]

b) Given G(A,B,C,D)= (A+B+C+D) (A+B+C+D’) (A+B+C’+D’) (A+B+C’+D) (A+B’+C+D’) (A+B’+C’+D’) (A’+B+C+D) (A’+B+C’+D)
i) Reduce the above expression by using 4 variable Karnaugh map, showing the various groups (i.e.octal, quads and pairs).                                                                                                                        [4]
ii) Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs.                                                                                                      [1]

Question 5
a). Draw the truth table and logic circuit diagram for a decimal to Binary Encoder.                        [5]
b) Define maxterms and minterms. Give one example of each.                                                          [2]
c) State whether the following expression is a Tautology or Contradiction with the help of a truth
table: (X↔Z). [(X→Y).(Y→Z)]                                                                                                                     [3]
Question 6.
a.    How many select lines does an 8:1 multiplexer have? Briefly explain the working of a 4:1 multiplexer with the logic diagram.                                                                                                 [5]
b.    Reduce the Boolean expression in to the simplest form. {(C.D)’+A’}+a+(C.D)+(A.B)            [5]

Section B
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.
A class Admission contains the admission numbers of 100 students. Some of the data members/
member functions are given below:
Class name : Admission
Data members
Adno[ ] :                      integer array to store admission numbers
Member functions
Admission( ) :            constructor to initialize the array elements.
void fillArray( ) :         to accept the elements of array in ascending order.
Int  binSearch(int l,int u, int v) :  to search for a particular admission number(v) using binary search and recursive  technique and returns 1 if found otherwise returns -1.
Specify the class Admission giving details of the constructor, void fillArray( ) and int binSearch(int,int,int). Define the main function to create an object and call the functions accordingly to enable the task.
               [10]

Question8.
In “Piglatin” a word such as KING is replaced by INGKAY, while TROUBLE becomes OUBLETRAY and so on. The first vowel of the original word becomes the start of the translation, any preceding letters being shifted towards the end and followed by AY. Words that begin with a vowel or which do not contain any vowel are left unchanged.

Design a class Piglatin using the description of the data members and member functions given below:
Class name
Piglatin
variables :

Txt
to store a word
len
to store the length
Member  functions :

Piglatin( ) 
constructor to initialize the data   members
void readstring( )
to accept the word input in UPPER CASE
void convert ( )
converts  the word into its piglatin form and displays the word (changed or unchanged)
void consonant( )
counts and displays the number of Consonants present in the given word.
Specify the class Piglatin giving the details of the constructor, void readstring( ), void convert( ) and void consonant( ). Also define the main function to create an object and call methods accordingly to enable the task.
                                                                                                                                                            [10]


Question 9.
A perfect square is an integer which is the square of another integer.  For example, 4, 9,16  are perfect squares. Design a Class Perfect with the following description:
Class name
Perfect

Data members/instance variables


n
stores an integer number

Member functions:


Perfect( )
default constructor

Perfect(int)
parameterized constructor to assign a
value to ‘n'.


void perfect_sq()
to display the first 5 perfect squares larger than ‘n’ (if n = 15, the next 3 perfect squares are 16, 25, 36)

void sum_of()
to   display   all   combinations   of
consecutive  integers  whose  sum  is
equal to n. ( the number n = 15 can be
expressed as
1          2          3          4          5
4          5          6                     
7          8                                 
                       


Specify  the  class  Perfect  giving details of the constructors, void perfect_sq( ) and void sum_of(). Also define the main function to create an object and call methods accordingly to enable the task.
   [10]

Section C
Answer any two questions

Each program should be written in such a way that it clearly depicts the logic of the problem step wise.This can also be achieved by using comments in the program and mnemonic names or pseudo codes for algorithms. The program 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 class Personal contains employee details and another class Retire calculates the employee’s Provident Fund and Gratuity. The details of the two classes are given below:
Class name

Personal



Data Members:




Name

   stores the employee name
Pan

stores the employee PAN number

basic_pay

stores the employee basic salary
acc_no

stores the employee bank account number
Member functions:




Personal( …. )
parameterized constructor to assign value to data members
void display( )
   to display the employee details

Class name


Retire



Data Members:





Yrs



stores the employee years of service

Pf



stores the employee provident fund amount








Grat



stores the employee gratuity amount
Member functions:




Retire ( …. )


parameterized  constructor  to  assign  value  to  data members of both the classes.
void provident( )
calculates the PF as (2% of the basic pay) * years of  service.
void gratuity( )
calculates the  gratuity  as  12  months  salary,  if  the years of service is more than or equal to 10 years    else the gratuity amount is nill.
void display1( )
Displays  the  employee  details  along  with  the  PF and gratuity amount.

Assume that the super class Personal has been defined. Using the concept of inheritance specify the class Retire giving details of the constructor, void provident () and void gratuity ().The super class and themain function need not be written.                                                                                                  [5]
Question 11.
Rack is a kind of data structure which can store utmost 20 books. The Rack restriction is that a book can be kept into the rack or removed only at one end and i.e., on the top. The class Rack has the following details.
Class name : Rack
Data members
book[] :            an array of string of maximum 50 locations to store books.
limit :    stores the capacity of the array
name : String variable to store name of the book.
top:      integer to indicate topmost book in the rack.
Member functions
Rack():constructor to store blank in the array book[].
Rack(int m) : constructor to initialize the data members m to limit and -1 to top.
void putthebook() : input name of the book into variable name and adds it on the top into the array[],
                               if possible else display the message “overflow”
void removebook() : to remove a book from the top of the rack, if array is empty then
                                display the message “Rack underflow”
void disp() : displays the books present in the list

Specify the class Rack giving details of only the constructor Rack(int), member function void putthebook (int), void removebook ().Assume that other functions have been defined.The main function need not be written.                                                                                                                                                            [5]



Question 12.

A) A Linked List is formed from the objects of the class,                                                                               [2]

Class Node

{

int num;

Node next;

}

Write the algorithm OR a method for inserting a node in the end of the list.

The method declaration is given below:

void insertnode(node start)                                                                                       

b) Answer the following questions from the diagram of a binary tree given below:-
        List the nodes in the tree given below using:
                                                                                          [3]

(i)        Preorder Traversal

(ii)       Postorder Traversal

(iii)      Inorder traversal

F



H

G

                             J                         P                                 M
                            I
                                                                                       
K                L                                              O                   N


1 comment: