0% found this document useful (0 votes)
33 views6 pages

Computer Science 2022-23

Computer question paper for isc class 12

Uploaded by

shubham.07012006
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)
33 views6 pages

Computer Science 2022-23

Computer question paper for isc class 12

Uploaded by

shubham.07012006
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/ 6
EE" thle. THE FIRST COMPARATIVE N { EXAMINAT) oi : Class XII (ISC) eee COMPUTER SCIENC Time: Thee hours Instructions: * Answers t Maximum marks: 70 this paper must be written on th : he answer script provided separatel * You will not be all : (He lowed to write during the fir his n st 15 minutes. This time is er ee time is to be Spent in reading the given at the head of the paper is the time allowed for writing the answers. * All subsections of each question must be answered in the correct order. * All working including rough work should be done on the same sheet as the rest of the answer. * Please do not write anything on your question paper except your name and roll number. * The intended marks for questions or parts of questions are given in brackets [ J. Do not copy the questions on your answer scripts. Copy the correct question number. * Answer all the questions from Part I and six questions from Part II choosing two questions from Section A, two questions from Section B and two questions from Section C. PART I [20 marks} Attempt all questions from this part. While answering questions in this part, indicate briefly your working and reasoning wherever required. Question 1 (a) State the law represented by the following proposition and prove it with the help of a truthtable: Pv P=P uw (b) Write the canonical POS expression of F(P, Q) = (0, 2) it) (©) Find the dual of XY + XY" =X+0 w (a) Find the complement of the following Boolean expression using DeMorgan’s law. iit) F(P,Q,R)=P+O'°R (c) Name and draw the logic gate represented by the proposition A <-> B iT) Question 2 z (a) State one use each of a decoder and a multiplexer. Ql (0) Differentiate between class variables and instance variables. 2} (c) How does tautology differ from contradiction? Write the truth table for a 2-input conjunction. (2) ‘ (4) Whatis the significance of keyword ‘this? in Java? Give its use. 2 (c) Give two differences between length and length() in Java, 2) ets Question 3 ‘The following is a function of some class which checks if « positive integer is a Palindrome number or not and returns true or false. (A number is said to be palindrome if the reverse of the number is equal to the original number.) The function does not use modulus (%) operator to extract digit, There are some places in the code marked by 212, ?22, 732, 242, 25? which may be replaced by a statement / expression so that the function works properly. boolean PafindromeNum (int N) { int rev = 212. int num = N; while (num > 0) { int f= mum/10; ints int digit = num— 2325 rev = 24? + digit, num /= 252; b if{rev==N) return true; else return false; (a) What is the statement or expression at 217 (b) What is the statement or expression at 72? (c) What is the statement or expression at 23? (What is the statement or expression at 242 (c) What is the statement or expression at 25? PART II [50 Answer seven questions in this part choosin, Question 4 (a) Given F(A,B,C,D)=2 (0, 1,2, (i) Reduce the above fant (octet, quad and pairs) the logi diagram for the reduced expression. Assume that the ‘bles and their complements are available as inputs. You may use gates with nore than two inputs. Given F(A%B,C,D) = x (0, 1, 2, 3, 4, 5, 6, 7, 10, 13, 14, 15) () Reduce the above function in POS form using K -map, showing the various groups (octet, quad and pairs). Gi) Draw the logic gate diagram for the reduced expression using NOR gates only. ‘Assume that the variables and their complements aré'available as inputs. You may use gates with more than two inputs. Question 5 (a) ~(b) (©) ‘A school intends to select candidates for the Inter School Athletic Meet, as per the criteria given below. «= The candidate is from the Senior School and has participated in an Inter School Athletic Meet earlier. OR « The candidate is not from the Senior School, but has the height between 5 ft and 6 f and weight between 50 kg and 60 kg. OR « The candidate is from the Senior School and has height between 5 ftand 6 ft but does not have weight between 50 kg and 60 kg. [anpuTs: | sa ‘Candidate is from the Senior School | W: Weight is between 50 ke and 60 kg | Hi: Height is between 5 ft and 6f l A: Taken part in an Inter School Athletic Meet earlier (Inall the above cases 1 indicates yes, 0 indicates no.) OUTPUT: X: Denotes selection (1 indicates yes, 0 indicates no in all cases.) © Draw the truth table for the inputs and outputs given above and write the SOP expression for X(S, W, H, A). From the logic circuit diagram given below, derive the Boolean expression for F and simplify it to show that it represents a logic gate. Name and draw the logic, gate, =) _ +p Using a truth table state whether the following expression is a Tautology, a Contradiction or a Contingency, ~(A AB) v (~A=>B) (1) (4) 0) [5] ie) 2) Question 6 (a) Draw the truth table and derive the SOP expression for sum and carry of a full adder. Also draw the logic circuit for the full adder using two half adders and an OR gate, (b) Simplify the expression F = [(X* + Y). (Y"+Z)]' + (X’ + Z) using Boolean laws. s()__ Draw the circuit diagram for (X + Y’) .(X’-+ Y) using NAND gates SECTION B [20 marks] Answer any two questions. ogram should be written in such a we can be achieved by using mnemonic names and comments in the program. (Flowcharts and algorithms are not required) Question 7 that it clearly depicts the logic of the problem. This A class BorderRey has been defined to reverse the value of all integers present in the boundary ofa two dimensional array of order m x n, The maximum value of both m and n is 20. The details of the class are: Class name BorderRev Data members/instance variables: arr 1] mn Member functions/methods: to store integers in the array to store number of rows and columns respectively. BorderRev(int mm, int nn) void fill() void reverse( ) constructor to initialize the size of the matrix. accepts the array reverses the value of all the integers present at the boundary of the matrix displays the array in matrix form. Specify the class BorderRev giving details of the constructor and methods. Also define the main() function to create an object of the class and call the methods accordingly. void display() Question 8° ‘Acclass DeciOct has been defined to convert a decimal number into its equivalent octal number. Some of the members of the class are given below: Class name DeciOet Data members/instance variables: a stores the decimal number oct stores the octal equivalent number, Member functions/methods: DeciOct( ) constructor to initialize the data members assigns nn ton calculates the octal equivalent of ‘n’ and stores it in ‘oct’ displays the decimal number ‘n’, calls the function deci_oct() and displays its octal equivalent. Specify the class DeciOct giving details of the constructor and methods. Write the main() function to create an object of the class and call the methods accordingly. Ta void getnum(int nn) void deci_oct() ; void show( ) (10) 10} question 9 Acclass Repeat has been defined to perform string r A g rela hens SEE ee arabes i related operations on a word. Some of the Class name Repeat Data member$/instance variables: str stores a word | len stores the length of the word newstr stores the modified word, Member functions/methods: _ Repeat( ) constructor to initialize the data members with legal initial values void readword( ) accepts a word in UPPER case S void modify() from the word stored in str removes all the occurrences of those letters which occur two or more times and stores | the remaining letters in newstr. (e.g. in ASSESSMENT repeated letters are ‘S’ and *E” therefore modified word becomes AMNT) void show( ) displays both the original word and the mo« Specify the class Repeat giving details of the constructor and methods, Define the to create an object of the class and call the functions accordingly. SECTION C [10 marks} ‘Answer any two questions. Each program/algorithm should be written in such a way that it problem step wise. Floweharts are not requl Question 10+ Ciass Binary contains an array of n integers (n <= 100) that are a | order. Other members of the class are: Class name Binary _. Data members/instance variables: At] integer array of 100 ~ a size of the array ' Lu location of the lower Memiber functions/methods: Binary(int nn) constructor to initial variables void input( ) to fill the elements int binary_search(int v) | Specify the class Binary giving details of the: ‘thm need not be written. Question 11 ‘A sequence of fibonacci strings is genetated as: denotes concatenation, Thus the sequence is: Design a class FiboString to generate fibonacei strings. Some o =a", $= “b", Sa= Sen + Sto-ay Where “+? , ba, bab, babba, babbabab, ....... 1 terms. f the members of the class are: Class name FiboString Data members/instance variables: x stores the first string y stores the second string a z stores the string that is created by concatenating the previous two terms“ n stores number of terms. Member functions/methods: FiboString() ? constructor to assign x= “a”, y= “b” andz= : void accept() accepts the number of terms : void generate) generates and prints the sequence of up to n terms Specify the class FiboSiring giving details of the constructor and In algorithm need not be written. Sr Question 12 ‘Write an algorithm or a method to delete an clement at index’ method declaration is as follows: void delete(int arrf J, int p) 4 S-

You might also like