0% found this document useful (0 votes)
26 views10 pages

CBSCOMPPAPER1

Computer Exam paper

Uploaded by

priyodiptobasak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
26 views10 pages

CBSCOMPPAPER1

Computer Exam paper

Uploaded by

priyodiptobasak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 10
Calcutta Boys’ School 2 Class: 12 Computer Science G Hours) Full Marks: 70 Answers to this Paper must be written on the answer bookiet provided separately. You will not be allowed to write during the first 15 minutes. This time is 10 be spent in reading the paper and preparing your work. The time given at the head of this Paper is the time allowed for writing the answers Answer all questions in Part ! (compulsory) and six questions from Part-I 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 [ J. PART |— 20 MARKS Answer all questions. While answering question in this part ,indicate briefly your working and reasoning wherever required . Question 1 # x+xy=xiscalled lew a) (2) _Involution (8) —_Distibution | (Absorption . (6) None of these GY The equivalent expression of x.(x+y) will be w @ y ® < 7 y @M «x # The expression of carry of ahalfadderis_— m @ ad (®) ab (ab (@)__None of these 9 The dual of x.y + ~y.2is: m @ — t+y)+(~y+z) (0) (x+y).(~y+z) © (xt~y)lyt~2) (@)__ None of these Page 1 of 10 CBS-I* Term Examination 2024 (b) and (c) both on: NAND and NOR Gates are called Universal Gates. a] e By using these two gates we cen implement any Boolean function. en all the inputs are logic 1, NAND gate produces a logic 0 output. And when . ‘all the inputs are logic 0, NOR gate produces logic 1 output. Which one of the option is correct — {@) Both Assertion and Reaso re true and Reason is the correct explanation of Assertion. (0) Both Assertion and Reason ar but Reason is not the correct explanation of Assertion. (© Assertior nite the complement of Boolean expression ~ a Fadcd)=[eHO+0.0+d)}) Write the inverse of p > q Q) What is an Abstract Class ? Give exemple (State De Morgan's Laws @ ay a With reference to the cade given below answer the questions dass Demo t Public static void isPrima{int n, int m) ae f(fag==0)5 System.out-printin(n+" is prime number"); 0 public static void main(int n) { int m=n/2; isPrime(n,m); zi a ‘What will be the output of the above code when n=3? fea) Explain the keyword static in the context of above code snippet ww Explain the use of flag variable in the context of above code snippet a acl Convert the following infix notation to postfix form. a (A-B) * (C/D) + (A*8) ‘A matrix A[15][13] is stored in the memory with each element requiring 4 bytes of storage. If the base address of A[1][1] is 2500, determine the address 2t A{8][7] when the Matrix is stored in Row major wise. RQ following function is a part of a lass which accepts two numbers and finds result true when the second number is lesser than the first otherwise it will false. There are some places in the code marked as ?1?, ?2?, 73? which quid be replaced by a statement/expression that the function executes property. int m=10, n=12; check obj=new check); boolean k=0bj.fn(m,n); + > (2) What is the expression/statement at 71? (B) What is the expression/statement at 72? (Q)_ Whatis the expression/statement at 23? ty G Qj PART I —SO MARKS Answer six questions in this part, choosing two questions from Section A, two from Section B and two from Section C. SECTION - 4. Answer any two questions Question 3 J) Gwen the Boolean function F (P,Q,2,S) = 2(0,2,5,7,8,10,11,13,14,15). 6 Beane an above exPresion by using 4-vaable K-Map. Showing the various groups fue. acta, ‘quads and pairs), Rraw the logic gate diagram (using basic gates only) forthe reduced expression. a ‘Assume that the variables and their complements are avaiable as inputs (2) | From the logic circuit diagram given below, ‘And (4) and finally derive the Boolean ei ‘the propositional connective which is 63 ae expression ‘Simplify %. Identity ‘equivalent to the simplified Boolean Ztion 4 ‘The Young-Men Club of Kolkata is a football club which is under Calcutta Football Federation (CFF). The club consists of a President, Secretary and a Treasurer. Any decision taken on development plans of the club can be implemented only if : + The President agrees and either Secretary or Treasurer agrees Or = All three agrees Or The CFF upload any circular The inputs are — & P: | Denotes the President's vote S: | Denotes the Secretary's vote T: | Denotes the Treasurer's vote C: | Denotes the circular of CFF Output X : denotes permission of development [1 indicates yes and 0 indicates for no] Draw the truth table for the inputs and outputs given above and write the SOP expression for X (P,S,T,C) [5] vy ve Draw the logic diagram of Full Adder and write the exfession of Sum and Carry (2+1+1] i) What is Universal gate? a) SECTION-B Answer any two questions Each program should be written in such a way that i clearly depicts the logie of the protilem. This can fe achieved by using mnemonic names and comments in the programs (Flowcharts and Algorithms are not required) The programs must be written im Sava. ‘Some of the members of the class are given below: Class name " PRIMEPALIN Data Members/Instance variables (set 7 to store the start of range. fend to Store the end of range. Member functions/methods : / PRIMEPALIN() + Parameterized constructor to initialize the Data members start=a, end=b / int isPriemei i) + eum 1 if the number is prime x. heswise, retars 0 1 ‘ot isPatindies i) : fetus 1 # the number is palindrome Gherwise, returns 0 (wb generatel) 2 generates al prime and palindrome sumbers between start and end by ‘tovoking the functions Primed) and Paint) and Cease PRIMEPALIN, cing detats ofthe constructor, functions tat wPrise(int), int iP atin and void generate(). Define 2 main() function to create an object and cali the methods axcordigly to eruthe the task. Use Scanner class to take input trom the User. BS-1* Term Examination 2024 embers of the class are given below. Class name Data Members/ Instance variables arr) lim. Member functions/methods ArrayMax(int n) void read) void large() void display() ArrayMax An integer array to store integer elements ‘An integer to store the order of the Matrix parameterized constructor to initialize the data member lim=n and to declare the array. to accept the array elements finds and displays the largest element in each row with an appropriate message. displays the array elements in matrix form sign a class ArrayMax contains a square matrix which finds the largest element in each row. Some of the Specify the class ArrayMax, giving details of the constructor, functions void read(),void large(), void Use Scanner class to take input as n from the User. | display(). Define a main() function to create Question 8 (20) the object and call the methods accordingly to enable the task. Design a class WordWise to separate words from a sentence and find the frequency of the vowels in each word, Example- Input : happy new year Outpul happy, Total vowel/vowels : 1 new, Total vowel/vowels : 1 year, Total vowel/vowels : 2 Some of the members of the class are given below. Class name Data Members/Instance variables str ls CBS-I" Term Examination 2024 WordWise to store a string (sentence) from the user to store the length (int) of the string. Page 7 of 10 Member functions/methods (Wordwiser) /void input() / void arrange(), va ~/ int frequency (String word) Specify the class WordWi function to create the obj input (string) from the U: ise, default constructor, ject and call the meth, Iser. displays each word of the sentence ina functions input(), arrange(), lods accordingly to enable the ta Default constructor to accept the string from the user separate line along with the frequency of vowels for each word by invoking a function frequency(), It takes a parameterized string input (word) and after calculation it returns the frequency of vowel/vowels present in that word, frequency(). Define a main() isk, Use Scanner class to take SECTION -C ‘Answer any two questions. Each program should be writen in such a way that it clearly depicts the logic of the problem stepwise, This can be achi ieved by ‘The programs must be written in Java and the alg, CarromCoins is an entity which can hold added or removed from one end only, Some of the members of classes are given below, Class name Data Members/Instance variables ‘ o) limit c 7 top Member functions/methods woid push() Y using comments in the pro, yeram and mnemonic names or pseudo codes for algorithms rithms must be written in 01 general / standard form, wherever required / specified. (Flowcharts are not required) (5) ‘maximum of 10 integers. The restriction is that an integer can be CarromCoins to store the integers to store the limit of the array Point out the index of the topmost element adds the integers to the top of CarromCoins. If the CarromCoins is full (lim-1) then it will display the message “It is full’, otherwise it will store the integer H!" Term Examination 2024 Page 8 of 10 delete the element from the top of the CarromCoins. If top=-1 then it will show a message that the CarromCoins is empty. omCoins giving details of the functions push() and pop().The main() and algorithm need Question 10 BI

You might also like