Page 679 - Computer science 868 Class 12
P. 679

(ix)  Differentiate between the connectives conjunction and disjunction                           [1]
                      (x)  State one application of  Multiplexer  and Decoder                                          [1]
                 Question 2.
                      (i)   Convert the following infix notation to postfix form :    ((A + B) - C * (D / E)) + F      [2]
                      (ii)   Each element of an 2d array CAL[15[20] requires ‘n’ bytes of storage. If the address of CAL[6][8] is 4580 and the Base
                         Address at CAL[1][1] is 4000, find the width ‘n’ of each cell in the array CAL[ ][ ] when the array is stored as Row Major
                         Wise.                                                                                         [2]
                     (iii)   A class testing_isc_specimen contains a function show(String, int). The code of the function is given below. Write down
                         the output of the function show() when the value of the String variable is COMPUTER and the value of the int variable
                         is 7. Dry run/working must be shown to prove the answer.                                      [3]

                         class testing_iscspecimen
                         {
                             void show (String str, int n)
                             {
                                 if(n>=0)
                                 {
                                     System.out.println(str.substring(n,n+1));
                                     show(str,n-1);
                                     System.out.print(str.substring(n,n+1));
                                 }
                                 else

                                     System.out.println("::");
                             }
                         }
                     (iv)   The following functions are part of a class which computes and returns true if the number is a Krishnamurthy Number else
                         returns false. There are some places in the code marked by ?1? , ?2? , ?3? which must be replaced by an expression/a statement
                         so that the function works correctly.
                          [Note: A Krishnamurthy number is a number where the sum of the factorial of its digits is equal to the number itself. For
                         example, 145 is a Krishnamurthy number.]
                         int factorial(int x)
                         {
                         if(x==0)
                         return 1;
                         else
                         return ?1?;
                         }


                         boolean isSpecial(int n)
                         {
                         int num=n, sum=0;
                         while(num>0)
                         {
                         sum+=factorial(?2?);
                         num/=10;
                         }
                         if(?3?)
                         return false;
                         return true;
                         }


                                                                                                                       677
                                                                                            ISC Specimen Question Paper  677
   674   675   676   677   678   679   680   681   682   683   684