Sunteți pe pagina 1din 7

ISC 2007( R ) COMPUTER SCIENCE PAPER 1 THEORY PART I Answer all questions in this part Question 1.

a) Verify the following using truth table A B C=(A B ) C b) Find the complement of the following using e !organ"s #aw $"%"&$"&$% c) 'implify and state the dual of the following e(pression) $%"($%"* & $ & $"*) d) 'tate the in+olution #as, Verify it using the truth table, e) -i+en F( $. %. * ) = ( $& % ) , ( %& * ) write the function in canonical product of sum form, [ 2 ! " 10# Question 2. a) /hat is a tree0 'how diagrammatically a tree data structure mar1ing its main parts, b) Con+ert the following into postfi( form) (A2B) 3 (C 4 ) & 5 c) 5ach element of an array ata67896:89 requires : bytes of storage, ;f the base address of ata689689 is 7888. determine the location of ata61896189 when the array is stored as column ma<or wise, d) =ame any two recursi+e data structures, e) 5(plain the term static, [ 2 $ ! " 10# Question %. a) int recs(intnum) > if(num==8) return 8? else returnnum& recs(num21)? @ +oid main() > int r=8? for(int i=8?iAB?i&&) > r=recs(i)? 'ystem,out,println(C i = C& i & C r= C&r)? @ @ b) public static +oid main('tring args69) > 1

int r? char d=E1E? for(int n=8?nA=F?n&&) > r = n&&? for(int a=8? aA=r? a&&) d&&? @ @ @ [ ! $ 2 " 10#

P&'tII
Answer any se+en questions in this part. choosing three questions from 'ection A and four questions from 'ection B, 'ection A Answer any three questions, Question (. a) -i+en the Boolean function F($. %. *. /)= G(8.1.7.:.B.H.I.F.18.11.17.1B) Jse Karnaugh"s map to reduce the gi+en function F. using the 'LM form, raw a logic gate diagram for the reduced 'LM form, %ou may use gates with more than two inputs, Assume that the +ariables and their complements are a+ailable as inputs, a) -i+en -($.%.*./)= N(8.D.:.H.O.F.18.11) Jse Karnaugh"s map to reduce the gi+en function - using the ML' form, raw a logic gate diagram for the reduced ML' form, %ou may use gates with more than two inputs, Assume that the +ariables and their complements are a+ailable as inputs, [ ! $ 2 " 10# Question !. Phe Manchayat Jnion of a particular +illage consists of : members2 a president and three officers in charge, Any decision ta1en on de+elopmental plans of the +illage can be implemented only if ) Phe president and at least one officer +ote a yes, LQ All three officers +ote a yes each, Phe inputs are ) A ) B ) C ) )

enotes the Mresident"s +ote, enotes the first officer"s +ote, enotes the second officer"s +ote, enotes the third officer"s +ote,

Lutput) $

enotes that a plan can be implemented, 6 1 indicates %es and 8 indicates =o in all cases9

a)

raw the truth table for the inputs and outputs gi+en abo+e and write the 'LM e(pression for $(A.B.C. ), [(# b) Qeduce $(A.B.C. ) using Karnaugh"s map, raw the logic gate diagram for the reduced 'LM e(pression for $(A.B.C. ) using A= R LQ gates, %ou may use gates with two or more inputs, Assume that the +ariables and their complements are a+ailable as inputs, [)#

Question ). a) /hat is a multiple(er0 5(plain the wor1ing of a multiple(er, [%# b) 5(plain the following)2 i) canonical sum of products ii) canonical product of sums [(# c) raw the truth table for a D2input =A= gate, Jsing =A= gates. draw A= R LQ gates, [%# Question 7. a) ifferentiate between an encoder and a decoder, [2# b) raw the truth table and logic circuit diagram for an octal to binary encoder, Briefly e(plain the wor1ing, [)# c) Verify if)2 (A&B),(A"&C)=(A&B&C),(A&B&C"),(A"&B&C),(A"&B"&C) [2#

Question *. a) raw a logic gate diagram for the following function using =LQ gates only, F(A.B.C)= A"B&AB"&C b) 'implify using laws of Boolean Algebra (AB&$&%&*), (AB&$"%"*") c) 'tate whether the following is true or false)2 ($&%),(%&*),($&*)= $(%&*) & %*

[(# [(# [2#

Se+tion , Answer any : questions, 5ach program should be written in such a way that it clearly depicts the logic of the problem, Phis can be achie+ed by using mnemonic names and comments in the program, (Flowcharts and algorithms are not required) T-e .'o/'&0s 0ust 1e 2'itten in C3345&6& Question 7. A class Nu01e's contains the following data members and member functions to chec1 for triangular numbers, 6 A triangular number is formed by the addition of a consecuti+e sequence of integers starting from 1,9 5g, 1&D=7 1 & D & 7 =H 1& D & 7 & : =18 1& D & 7 & : & B = 1B Pherefore 7.H.18.1B are triangular numbers, C8&ss n&0e 9&t& 0e01e's n Me01e' :un+tions +oid getnum() int chec1(int) +oid dispnum() ) ) =umbers integer to be chec1ed whether it is triangular or not,

) ) )

to accept integer n, to chec1 if n is triangular, to display message whether n is triangular or not,

'pecify the class =umbers gi+ing details of the functions +oid getnum(). int chec1(int) and +oid dispnum(), Phe main function need not be written,

[ 10#

Question 10. efine a class 9u.8i+&te to pac1 an array of 18 integers which are sorted ( to pac1 means to remo+e all duplicates from the array), For eg, ;f the gi+en array has the following sorted numbers) 1 D 7 7 : : : B H H Phe resultant array should contain each element once, Phe output should be) 1 D 7 : B H 'ome of the members of the class are gi+en below)2 C8&ss n&0e ) uplicate 9&t& 0e01e's num69 ) integer array with 18 sorted integers, !ember functions) +oid read#ist() +oid pac1#ist() +oid disp#ist(int)

) ) )

to enter elements of the array in sorted order, to remo+e duplicates from the array, to display the array of integers without any duplicates,

'pecify the class uplicate gi+ing the details of the functions +oid read#ist(). +oid pac1#ist() and +oid disp#ist(int), Phe main function need not be written, [ 10 # Question 11. efine a class 1&seP'o and a deri+ed class der+Mro to find the product of two numbers, Phe details of both classes are gi+en below) C8&ss n&0e ) baseMro 9&t& 0e01e's n1. nD ) float cariables whose product is to be determined, Me01e' :un+tions) +oid enter() +oid show() C8&ss n&0e 9&t& 0e01e's result Me01e' :un+tions +oid prod() +oid disp()

) ) ) ) )

to enter +alues for n1 and nD, to display the +alues of n1 and nD, der+Mro float +ariable to store product

) )

to accept +alues for n1 and nD and to calculate their product using the concept of inheritance, to display the +alues of n1. nD and their product,

a) 'pecify the class baseMro gi+ing details of the function +oid enter() and +oid show(), b) Jsing the concept of inheritance specify the class der+Mro. gi+ing details of the functions +oid prod() and +oid disp(), Phe main function need not be written, [ 10 # Question 12. A class ;e+<,in has been defined to con+ert a decimal number into its equi+alent binary number, 'ome of the members of the class are gi+en below) C8&ss n&0e 9&t& 0e01e's n s i !ember functions decSBin() +oid getdata() +oid recursi+e(int) +oid putdata() ) ) ) ) decSBin integer to be con+erted to its binary equi+alent, binary equi+alent number, incremental +alue of power,

) ) ) )

constructor to assign initial +alue to the data members, to accept the +alue of n, to calculate the binary equi+alent of n using the recursi+e technique, to display the decimal number n and its binary equi+alent,

a) 'pecify the class decSBin. gi+ing details of the constructor and the functions. +oid getdata(). +oid recursi+e() and +oid putdata(), Phe main function need not be written, [*# b) -i+e any two differences between the recursion and iteration process, [2#

Question 1%. A class InsSo't contains an array of B8 integers, 'ome of the members of the class are gi+en below) C8&ss n&0e ) ;ns'ort 9&t& 0e01e's arr69 ) an array of B8 integers Me01e' :un+tions ;ns'ort() +oid readarr() +oid showarr() int smallarr() +oid sort()

) ) ) ) )

default constructor to input B8 integers to display the list of sorted integers returns the inde( of the smallest integer in the array before sorting sorts the array in ascending order using the insertion sort technique

'pecify the class ;ns'ort gi+ing the details of the constructor and the functions +oid readarr(). +oid showarr(). intsmallarr() and +oid sort(), Phe main function need not be written, [ 10 #

Question 1(. efine a class 0o;iSt'in/ with the following details) C8&ss n&0e ) 9&t& 0e01e's stra.strb.strc ) ch )

modi'tring to store three strings of ma(imum length 18, character which replaces first character of each string,

Me01e' :un+tions +oidgetstr() +oid change()

) )

+oid ne(t()

+oid print()

to accept the three strings, to accept character ch and to replace the first character in each string with this character, (foreg, ;f 7 strings are )2 sore. bunch. such and the accepted character is Tm" . then the display is ) more . munch. much), to change the original string by con+erting each character to its successi+e character, (foreg, ;f the three strings are sore. bunch. such . then the display is tpsf. c+odi. t+di), to display the changed strings calling both the functions change() and ne(t(),

'pecify the class modi'tring gi+ing the details of the functions +oid getstr(). +oid change(). coidne(t() and +oid print(), Phe main function need not be written, [ 10 #

S-ar putea să vă placă și