Page 1 :
MERCY MEMORIAL SCHOOL, ISC HALF YEARLY EXAMINATION 2021-22, , COMPUTER SCIENCE (Paper 1) THEORY, Date: 29/09/2021, , Maximum Marks: 70, Time allowed: One and a half hours, , (Candidate are allowed additional 15 minutesfor only reading the paper), ALL QUESTIONS ARE COMPULSORY, The marks, , intended for questions are given in brackets | 1, ****--****-*-*, , Select the correct, , ---------------------------------------, , option for each of the following questions., , ******--*----------~--*-----------~~---, , The dual of the Boolean equation (X+Y+1) XY, X.Y.0 =(X+Y°). 1, , 1., , =, , +0:, , [11, , b) X'.Y.0 =(X'+Y).1, c), , X.Y.0 =(XY').1, , d) X+Y+0 (XY").1, 2., , Full adders are used for:, , a) Adding two binary bits, , Adding, , three binary bits, , c) Converting Decimal to Binary, d) Converting Binary to Decimal, 3. The combinational circuit which receives 2", input signals and, signal is:, a) Full Adder, b) Decoder, c) Half Adder, , returns, , only one/single output, , Multiplexer, 1fX A'BC + AB'C + ABC, when A, 1; B= 0; C=0, , 4., , a), , d, , AB'C° +A'B'C°, , then choose the, , value, , of XK, , 2, , 0, , c), -, , With reference, , 5., , +, , to, , the, , given propoSition-, , the, , P, , b)Q, , contrapositive of the proposition, , is:, , -P, , c)PQ, , d) P Q, 6., , The compliment of the Boolean expression, a) (1+M'). (N°+O).(1+M+N), b) (1.+M + N+O', +LiM'+ N'), , +M)., , (N+(0').(1+M' N'), , d (1M+ NO + LMN), , F(l,, M,, , N, O), , =, , ( LM, , N'O, , 1.'MN), , [
Page 2 :
7. The propositional operator, , a, , represents:, , a) Conjunction, b) Implication, Disjunction, d) Negation, The law which representsthe, a) Absorption Law, , 8., , Boolean, , equation, , A +B.C=(A, , +, , B). (A +C) is:, , b) Associative Law, c) Commutative Law, d, , 9., , Distributive Law, , The Canonical Product, , -, , of- Sums form, , of F( A, B) =(A +B). A, , is:, , a) (A+B).A'.B, , b) (A +B).A'+B', c) (A+B).(A'+B'), , ( A +B).(A' +B).(A' +B') its Maxterm, 10. If A 1, B= 1, C =0 and D= 1, select, , [11, , =, , a A ' +B', , b) A +B, c), , +C+ D', , +C'+D, , A'.B.C.D, , d) A.B.C'.D, , 11. The Canonical Sum, , -, , of - Products form, , a), , Y'Z' + X'YZ, , b), , X'Y'Z' +X*YZ+XY'Z', , c), , X'Y°Z +X'YZ' +XYZ', , +, , XYZ, , 12. What is the output of the code, , given, , of, , dNone of these, void demo0, int c, s=0;, , for(int a-2; a<5; ++a), for (int b=1; b<a; ++b), Ca+b - 1;, , if(c%3-0), S+C, else, , S+C+5, System.out.println("s =, , a) 42, b) 38, c) 44, , None ofthem, , "+s);, , below?, , F(X, Y, Z), , =, , (21, , 2(0, 3, 4) is:, M, , tMa, , M, , 21
Page 3 :
13. The basic logic gate that represents the simplification of the Boolcan expression, , 2, , A.(A +B') + AB +Cis:, , aOR gate, b) NOT gate, c), , AND gate, , d) None of these, , 12, , (14.)What is the output of the code given below?, class Cricket, int runs;, , public static void main(String[] args), Cricket cl = new Cricket( );, , el.runs= 250;, Cricket c2 new Cricket( );, c2 c l ;, c2.runs= 300;, System.out.println("Runs=, , a), , ", , +, , cl.runs);, , Runs=0, , b) Runs=250, , Runs=, , 300, , Compile Time Error, , d, , 15Choose the Canonical, , Sum -of- Products form, , (x+y' +z). (x +y, a), , +z').(x', , of the following:, , 2, , +y' +2). (x' +y' +2'), , x'y'z +xy'z' +x'yz + xyz, , b) xyz + xyz' +xy'z +x'yz, , c) x'y'z'+ xyz' + y'z, e x y ' z +x'y'z' + x'yz + xy'z, , is stored in the memory in Column Major Wise with each element requiring, is 1500 and the address at arr[4][5] is 1608,, 4 bytes of storage. the base address at arr[1]], be:, then the number of rows of the matrix will, , (16) A matrix arrfm][n], , If, , a) 5, 6, , c), d), 17., , 7, , None of these, of:, Given below the truth tables, , A, , i), ii), iii), , B, , Output, , NAND gate, AND gate, OR gate, NOR gale, , [21
Page 4 :
b, A, , B, , C, , 0, , Output, , 0, 0, 0, , 0, XNOR gate, 11), , OR gate, , iii), , XOR gate, AND gatee, , iv), , (18.)Simplify (A +B'). (B +C.D)' and select the correct answer:, , [2, , a) B'C +B'D', , b) BC+BD, c) ABC' +AB'D', , +B'C'+ BD, AB'D' +B'C* +BD', , ABC+, , 19. With reference to the, program code, , (a) What is the method demo(), void demo( ), int, , given below,, , answer, , performing?, , the, , questions that follow:, , mat[ 1[]= new int[3][3];, , for(int i = 0;i<3;i++), , for(int j 0:j<3:j++), =, , System.out.print(mat[j]fi]+"\t");, System.out.println( );, (i), (ii), , (b) What, , (iv), , Performing Matrix multiplication, Printing Transpose of a matrix, Printing original matrix, , Performing 180° Rotation and printing, , is the method, , void test(), , test() performing?, , intar[ I[]={{1,2,3 ,{4,5,6}.{7,8,9}:, int br[ I[ ], , and, , new int, int k=ar.length - 1, =, , [3][3];, , for(int i-0;i<3;it+), , for(int j-0;j<3:jt+), br[i10lar(iJlk-jl:, for(i-0;i<3;i++), , forj-0:j<3:j++), , System.out.print(brjiljH"\t");, , printing
Page 5 :
System.out.println();, , (), (ii), (ii), , Performing 180" rotation and printing, Performing 360" rotation and printing, Generating Transpose of the matrix, Generating Mirror image of the matrix, , (20vvoid display(), , hat is the output of the code, , given below?, , (2, , intar[]={18.6, 16. 2, 26, 9, 1}, for(int x = 0; x <= 5; X++), , for(int, , 0; y <6-X; y++), , =, , y, , ifar[y]>ar[y+1]), intt= ar[y]:, ar[y] =ar [y+1];, , ar[y+1]=t;, , for(int x = 0; x <6;xt+), , System.out.print(ar[x]+"\t");, (a) 18, , 6, , (b) 26, , 18, 2, , (d) 1, , 2, , 16, 16, , 66, , 2, , 26, , 9, , 1, , 9, , 6, , 2, , 1, , 9, , 16, 16, , 18, 18, , 26, , 9, , 21, (1), , (3), , F(X.YZ), (2), , From the, answer, , logic diagram given above,, following questions:, , the, , a) The expression at (1) is:, G), X. Y, +, , Y, , (iii) X+Y, X.Y, (iv), b) The expression at (3) is:, ), (ii), , X.Y' +X +Z, , (iv), , (X+Y').(X+Z), , ), , X.Y.(X+Z), (X+Y').(X.Z), , where x, Y and, , Z are inputs, , and F is the, output,
Page 6 :
c)The final expression F(X,Y,Z) is:, F-(X+Y"). XZ +Z, F=X.Y' +X+Z', (i), , F-(X +Y'). (X+Z) +Z, F-X.Y.(X +Z) +Z, , (iii), (iv), , 10, 11. 12, 14, 15) by using, F(A,B.C.D) 2(4, 6, 7,, Karnaugh map and answer the following questions:, for reduction?, and their types formed, of, a) What will be the least number groups, , 22. Reduce the, , given, , Boolean function, , =, , ), , 2 quads and 1 pair, , (ii), , 3 quads, , (ii), , 6 pairs, quad and 3 pairs, , (iv), , b)/The reduced expression, i), (ii), (iii), , A), , 4 variabie, , of the Boolean function given above is:, , (21, , AC +A'BC + BC'D', , (B+C).B+D'). (A' +B+C), BC +BD' +A'BC, , AC +BC +BD, , 23. A government institution intends to award a medal to a person who qualifies any one of the following, , criteria:, T h e person should have been an Indian citizen and had lost his/her life in a war but has not, , completed 25 years of service., OR, The person must be an Indian citizen and has served the nation for a continuous period of, 25 years or more but has not lost his/her life in a war., OR, The person is not an Indian citizen but has taken active part in activities for the upliftment, of the nation., The inputs are:, , Inputs, Theperson is/was an Indian citizen, Has a continuous service of more than 25 years, , Lost his/her life in a war, Taken part in activities for upliftment of the citizen, (In all the above cases I indicates YES and 0 indicates NOD)., , D, , Output: X [l indicates YES and 0 indicates NO for all cases]., Draw the truth table for the inputs and outputs grven above and answer the following questions:, a) The POS expression for X(A,B,C,D) will be:, , (i), (ii), , X(A,B,C.D) = 2(1,3, 5, 7, 10, 11, 12, 13), X(A,B,C,D) = n (1, 3, 5, 7, 10, 11, 12, 13), , X(A,B,C,D) = 2(0, 2, 4, 6, 8, 9, 14, 15), , (iv), , X(A,B,C,D) = « (0, 2, 4, 6, 8, 9, 14, 15), , b) What will be the least number of groups and their types formed for reduction?, , (i), (i), (iii), , (iv), , 4 pairs, I quad and 3, 5 pairs, 1 quad and 2, , pairs, pairs, , [2
Page 7 :
Reduce the given Booiean function, , using, , a), , F( P, Q. K,, d ) ( 2,3, 6, 7, 9, 11, 12, 13, 14, 15) by, and, variable, 4Karnaugh map, answer the tollowing questions, What will be the least number of groups and uicir, , types formed for reduction?, , 1 quad and 3 pairs, 2 quads and I pair, , (), , (i), , 5 pairs, 1 quad and 2 pairs, b) The reduced expression of the Boolean function, (iv), , (i), (ii), , (P +Q).(P +R°). (P+Q+S), , (ii), , (P'Q) +(P.R°') +(P".Q.S), , is:, , [2, , (P+Q).(P +R). (P +Q' +S), , (P+Q).(P'+Q+S'). (P+Q+ R°). (P +0' +R'), , (iv), 25. What is the, , a), , given above, , output of the statements given below:, , System.out.println("Total" +20+ 100 + balls");, Total120balls, , (1i), , Total20100balls, , ii), , Syntax error, No output, , (iv), b), , System.out.println("A*" + 1+ "C");, i) 65+1+67, ii), , A49C, , (ii), iv), , AIC, , ), , 234 + A, , (ii), , 234A, 299, , iv), , 234, , 65+49 + 67, c) Systenm.out.println(Integer.toString(234)+"A");, , +A, , 26. With reference to the, program code, int test(int x, int y), int p= 1,, , given below,, , answer, , the, , questions that follow:, , n =x;, , while(y> 0), if(y %2= =1), p*n, y2;, n, , *= n,, , return p:, , (a) What will the method test(), 9, (1), 20, (ii), 635, (iii), , return, , when the value of x, , =, , 5 and y, , =, , 4?, , 21, , 625, , (b) What is the method test(), (i), , (ii), (iv), , performing?, , Returning *x' raise to power of "y, Returning 'y' raise to power of 'x, , Returning sum of "x' and 'y', Returning product of 'x' and *y, , [1
Page 8 :
27. With reference to the program code, void func(int num, int d), , that, given below, answer the questions, , follow:, , int quo=0;, , int rem =0;, , while(num>1), n u m = n u m - d;, , quo, , rem, , =, , quo + 1;, , num;, , System.out.println("Resultl =, , "+quo);, , System.out.println("Result2 =, , ", , +, , rem);, , (a) What will the method func() return when the value of num = 20 a n d d = 4 ?, , (2, , Resultl= 5, Result2 0, , (i), , Resultl=0, Result2 5, , ii), , Resultl =5, , (iv), , Result2 20, Error, , b) What is the method func( ) performing?, , (11, , Dividing num by d, Dividing d by numn, i, (i) Subtracting num by d, (iv) Error in the programn, 28. With reference to the program code given below, answer the questions that follow:, void dimen(int n[ ][ 1), int p=0;, , for(int i-0; i<n.length; it+), , for(int j-0; j<n[0].length; jt+), if(i =0 && i l= n.length, , pt nlili:, , -, , 1, , && j !=0 && j !n[0].length-1), , System.out.println(p);, value of, (a) What will be the output of the method dimen() when the, , n[ I= {{1, 3, 5), {1, - 5,9), {10, -6, -3}1?, 0), , (ii), (iv), , 20, 38, -5, 15, , (b) What is the method dimen( ) performing?, , (i), , Finding the product of the boundary elements, Finding the sum of the non- boundary elements, , (iii), , Finding the sum of the boundary elements, Finding the sum of the matrix, , (iv), , (21
Page 9 :
29. With, , reference, , static void, , the program code, fun(String [ ]s, int n), to, , given beloW,, , answer the, , questions that, , follow:, , for (int i= 1;i <n; it+), String temp= s[i];, intj =i - 1:, , while j>=0 && temp.length() slj].length0), <, , s[i+1]= s[, , j, sj+1] = temp;, , (a) What will be the output of the method fun( ) when the value, of n=4 and, s[]= {"examinations", "our", "improves", "knowledge"};, , (i), (ii), , improves knowledge examinations, examinations improves our knowledge, our, , 2, , examinations improves knowledge our, , examinations knowledge improves our, , i, , (b) What is the method fun( ) performing?, (i), (i), , Sorting the array of string in alphabetical order., Sorting the array of string according to the length in ascending order., , Sorting the array of string according to the length in descending order., Writing the string in an order., 30. With reference to the, program code given below, answer the questions that follow:, , (iv), , void guess(int number), , for(int i =2; i< number; it+), , while(number%i= =0), System.out.print(i + "\t");, number = number/li;, , if(number >2), System.out.print(number + "\t");, , (a) What will be the output of the method guess) when the value of n, , ), (ii), (iii), , 10, , 2, , 5, , 2, 10, , 3, , 15, , 20, , tiv) 2, 3, 5, (b) What is the method guess() performing?, ), Factors of 'number, Table of 5 till 30, i i ) Prime factors of 'number, , 30, 25, , 30, , 15, , 30?, , 30, , 21
Page 10 :
None of the above, , (iv), , Seareh. Assume, class written to do the Binary, a publie member function of some, is, returns I else returns 0. There, 31. The following, in the arri then it, is, order., present, 'm, in ascending, If, which are to be replaced by a, array arr ] is, 23?. ?4?, and 5, the code marked as ?1?, ?22., are some places in, code works properly, statementexpression so that the, , int search (int m, int arrí ). int size), , intfound-0:, intj0, k = ?1?:, if(?2?), while(?3?), , inti-g+k)/2., , ifmarrfi}, found, 74?:, , 1, , else, (?5'), clse, , k-i-1, , rcturn found;, , Answer the following question:, , a), , What is the, , statement or expression at, , ?1?, , size, , (), , S1ze, , (ii), 1, , (iv), b) What is the, (1), , statement or, , (ii), , found = 00, , (iv), , found = =1, , found =, , c), , What is the, (i), , (iii), (iv), d), , enpressi0n, , What is the, , :, , 2?, , found= 1, =0, , statement or, , expression at, , ?3?2, , expression at, , 24?, , j, j= k, k=j, , k>, statement, , or, , (i), , Break, break, , (iii), , continue, , (iv), , Continue
Page 11 :
e) What is the statement or expression at ?5?, m= found, ), m <arr[i], 11), (iii) found==1, m> arrfi], 32. The, , following function, , checks if the, , positive integer, , statement/expression so that the code works properly, , boolean unique(int num), int m=num, dig, c, d=0, n=num, dig2, a=0;, for(int i=0; ?1? ;i++), , m=num, , 2?, , while(m>0), {, , dig = ?3?;, , if(dig==i), , c++, m/=10;, , if(?4?), , d+t, hile(n>0), , dig2, , n%10;, , att, , n/=10;, if(25?), return true;, , else, return false;, , Answer the following question:, a) What is the statement or expression, , (ii), (ii), (iv), b)What is the, , ), , (iii), iv), c), , a, , unique, , by returning true or, duplicate digits. There, , number, , with no, Unique number is a positive integer (without leading zeros), which are, ?5?, ?4? and, some places in the code marked as ?1?, ?2?, ?3?,, , false. A, are, , 'num' is, , ?1?, , at, , ?2, , i> 10, 9, statement or, , expression, , C = 0, , cnumn, , c= dig, , What is the statement, , (), i), , at, , i=9, i<9, , or, , num+1, dig+1, , (ii), m/10, m%10, , expression at, , 73?, , to be, , replaced byya
Page 12 :
d) What is the, , statement or, , (), (i1), , C, , e), , ii), (iv), , 24?, , d, 0, , c, , Vhat is the statement or, a, d, , (ii), , at, , C=-, , C, , (iv), , expression, , expression at 25?, , a==1, d==l, a! 1, , *************************