Sunteți pe pagina 1din 6

Important Paper 2013

Class XII Subject Computer Science(Paper 1) Time: 3 hours Max Marks:100 Answer all Questions in Part I (compulsory) and seven questions from Part II, choosing three questions from Section A and four questions from Section B. PART I (Answer all questions in this Part) While answering questions in this Part, indicate briefly your working and reasoning wherever required Question 1. [10] (a) Simplify A.B+A.C+B.C using the laws of Boolean Algebra. At each step state clearly the law used for simplification. (b) Find the complement of F((a, b, c, d) = [ a + { (b + c) . (b + d) } ] (c) State Absorption Laws. Verify one of the Absorption laws using a truth table. (d) An array m[-2..5,-1.4] is stored using row major implementation the address of m[0][0] is 176 and the address of m[4][3] is 230. Find the address of m[3][2]. (e) Write the preorder and post order traverse for following binary tree. 48 15 7 26 18 22 Question 2: (a) Convert the following infix expression to its postfix form: (A+B+C)*D/E^F/G*(H-I+) +J (b) Show that if x.y=0, then x y= x + y. (c) State De Morgans law. Verify one of them using the truth table. (d) Obtain the logic circuit of the following boolean expression using NOR gates only F(X, Y, Z) = (X + Y). (Y + Z). (Z + X) (e) Write the product-of-sum for the Boolean function, F(A,B,C) whose output is 0 only when: A=1, B=0, C=0; A=0, B=1, C=0; A=0, B=0, C=1; A=1, B=1, C=1 Question 3. (a) The following strange function is a part of some class. Assume that the arguments x and y are grater than 0 when the function is invoked. Show the dry run/working. int strange(int x, int y) 55 59 78 70 80 86 [10]

{ if (x>=y) { x = x y; return (strange(x, y)); } else return x } (i) (ii) (iii) What will the function strange (20, 5) returns when invoked? What will the function strange (20, 5) returns when invoked? In one line state what the function strange ( ) is doing? [2] [2] [1]

(b) State the final value of q at the end of the following program segment after execution. Show the dry run or working: int m, n, q=0, p; for(m=2; m<=3; ++m) { for(n=1; n<=m; ++n) { p= m+n-1; If(p%3= =0) q + = p; else q + = p + 4; } } PART B (Section 1) (Answer any three questions) Question 4: (a) Given the following Boolean function [5]

F (a, b, c, d) = (5,6,7,8,9,10,11,12,13,14,15). Use Karnaugh's map to reduce this function using the given SOP form. Draw the logic gate diagram for the reduced SOP expression using AND and OR gates. You may use gates with more than two inputs. Assume that variables and their complements are available as inputs. (b) Given F (a, b, c, d) = (0, 1, 3, 5, 6, 7, 10, 14, 15) [5] Use Karnaugh's map to reduce this function using the given Pas form. Draw the logic gate diagram for the reduced POS expression using OR and AND gates. You may use gates with more than two inputs. Assume that variables and their complements are available as inputs. Question 5: In Big Bazar the shopping could be done using cash or credit card of ICICI bank. Customer will be given bones point depending upon given condition. Shopping using credit card. Shopping of item which carries bones points. Shopping using cash but above amount Rs 500.

Where C represents credit card (1 for payment by credit card 0 for not payment by credit card) A represents cash (1 for payment by cash 0 for not payment by cash) M represents amount (1 for money >=5000 and 0 for money <500) II

I represents item (1 represent item carries bones, 0 represent item do not carries bones) B represents Bonus (1 represents bonus points given, 0 represent bonus points not given) A) Draw the truth table to represent B using C, A, M, I? Find SOP expression for it. [5] B) Reduce above SOP expression using K Map. And draw the Logic gate for it. [5]

Question 6: (a) Draw the truth table and logic circuit diagram for a Octal To Binary Encoder. [6] (b) Verify if X. Y.Z + X.Y.Z + X.Y.Z + X.Y.Z = X.Y + Y.Z + Z.X [4] Give reasons at every step. Question 7: (a) What is full adder? Write the SOP expression for sum and carry. Simplify the expression algebraically for sum using Boolean Algebra. [6] (b). What is Decoder? Give any one application of a decoder. [2] (c ) Using Truth Table Verify: A + B.C. = ( A + B ) . (A + C) [2] Question 8: A full subtractor is a combinational circuit that performs the subtraction between two bits , taking int account that 1 may have been borrowed by a lower significant stage. Following is the truth table for the full subtractor. It has 3 inputs: M, S and P. it has two output: B and D. INPUT OUTPUT Minuend(M) Subtrahend(S) Previous Borrow(B) Difference(D) Borrows(P) 0 0 0 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 0 0 1 1 1 1 1 a) Write the SOP expression for B and D. Use Karnaughs Maps to reduce B and D if Possible. [7] b) Now Draw logic gate diagram for B and D using AND and OR gates. You may use gates with more than two inputs. Assume that variable and their complement are available as inputs. [3] SECTION B [40 Marks] (Attempt any four 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. Question 9: A class called Numeric has been defined to find and display the frequency of each digit present in the number and the product of the digits. Some of the members of the class are given below: Data members Member functions Numeric (long a) void frequency( ) int product( ) : : : : : n-long integer type. A constructor to assign a to n. to find the frequency of each digit in the number n, and display it. to return the product of the digits of the number.

III

Specify the class Numeric giving the details of the constructor and the functions void frequency ( ) and int product ( ). Write the main method to create the object and print frequency of each digit and product of each digit by calling above method. [10] Question 10: Design a class Convert to convert a decimal number to its equivalent in base 2 and to convert this binary number back to its decimal equivalent. E.g. (i) The decimal number 35 is 100011 in base 2. (ii) The decimal equivalent of binary number 100011 is 35. Some of the members of the class are given below: Class name : Convert Data Members/ Instance Variables: N : integer to be converted to base 2. Member functions/ methods: Convert( ) :constructor to assign 0 to instance variable. long binary (int ) :to convert and return binary form of parameterized value. int decibin(int ) :to convert and return decimal value of binary number passed in parameter Specify the class Convert giving details of the constructor and the functions along with main method that accept a number and convert into binary form and again this binary number converted into decimal form. It print BRILLIANT if both the results are same otherwise print BETTER LUCK NEXT TIME. [10] Question 11: A palindrome number is one that reads same from left to right or right to left. Example: 12321, 9834389. There is an ingenious method to get the palindrome from any positive integer. The procedure is as follows: 1. 2. 3. 4. Start with any positive number of 2 or more digits. Obtain another positive number by reversing the digits of the starting number. Add the 2 numbers together. Repeat the whole procedure with the sum as the starting number till you get the sum which is the palindrome number.

Example: start with 87. 1st Step 87 78 Sum= 165 2nd Step 165 561 726 3rd Step 726 627 1353 4th Step 1353 3531 4884

A class Palin is designed to get a palindrome number from a positive number. A class Palin is designed to get a palindrome number for a positive number. Class Palin is defined as follows: Data member: int num : to store a 2 digit positive number. Member functions: Palin(int) : a constructor to initialize num with parameter. boolean palindrome(int) : used to return true if parameterized value is a palindrome otherwise return false. int ingenious( int) :a function that calculates and return the palindrome number for parameterized number if it is found within 5 steps otherwise returns -1.

IV

Specify the class, giving details of the functions members along with main method that accept a number and print its palindrome number by calling above methods. [10] Question 12: Class MyArray contains the employee code of 100 employees. Some of the member function/ data members are given below: Class name Data member Member Function: MyArray() void fillarray() void sortArr() : MyArray : arr[ ] integer

: to assign the code to 0. : to input the code in the arr[] :to sort the array variable using selection sort technique. int binarySearch(int code) :to search and return 1 if an employee code is found in the array object else return 0. Write the class details. You do not need to write the main function. [10] Question 13: Class Name : Point Member Data : x ( x coordinate), y ( y coordinate ) Member Function : Constructors : Default and Parameterized void display() : display point double findDistance( Point) : inputs a point as parameter and returns distance between current object and parameterized object them. Point findMidPoint( Point ) : returns midpoint between current abject and parameterized object. Now write a main method that accept to two point and calculate its mid point and distance between them with the help of above methods. Question 14: Class Name Data Members Member Function Saddle(int nk) void displayArray( ) void saddlePoint() : Saddle : int arr[ ][ ] an integer array which can hold max 20 x 20 elements int N size of 2D integer array (square matrix form) : : to initialize N to nk and accept only positive number in it. : to display array in matrix form. : to find the SADDLE POINT for the matrix. A saddle point is an element of the matrix such that it is the minimum element for the row to which is belongs and the maximum element for the column to which it belongs. Saddle point for a given matrix is always unique. If the matrix has no saddle point, output the message NO SADDLE POINT.

There is no need to write the main method. Question 13: Your computer science teacher is trying to analyze the performance of the class in the previous exam. He has a class called Performance, which contains the marks of 60 students in the class. These are not sorted. He wants to find two quantities. Mode: the most frequently occurring mark in the class. If two or more marks occur equally frequently then the highest of these marks is the mode. mode frequency: ,frequency at mode V

You can make the following assumptions: the class has 60 students the maximum marks anyone can get are 100 and the minimum is 0 all student marks are whole numbers. Important: You are not allowed to sort the marks. Some of the member functions/methods of Performance are given below: Class name Performance Data members/instance variables: mark[ ] an integer array to store the marks of 60 students. mode-to store the mode , freqatmode-to store the frequency at mode. Member functions/methods Performance( ) void readmarks( ) int getmode( ) int getfreqatmode( ) :constructor, :for reading the marks into the array, :for returning the mode, : for returning the frequency at mode ,

void calcmodeandfrequency( ):a single function that calculates both mode and frequency at mode. Specify the class Performance giving the details of the constructor, int getmode( ),int getfreqatmode( ), void calcmodeandfrequency( ) only. You may assume that the other functions are written for you. You do not need to write the main function. .

VI

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