{"id":47427,"date":"2024-02-09T10:07:25","date_gmt":"2024-02-09T04:37:25","guid":{"rendered":"https:\/\/www.aplustopper.com\/?p=47427"},"modified":"2024-02-09T13:16:10","modified_gmt":"2024-02-09T07:46:10","slug":"isc-class-12-computer-science-previous-year-question-papers-solved-2011","status":"publish","type":"post","link":"https:\/\/www.aplustopper.com\/isc-class-12-computer-science-previous-year-question-papers-solved-2011\/","title":{"rendered":"ISC Computer Science Question Paper 2011 Solved for Class 12"},"content":{"rendered":"
Maximum Marks: 70
\nTime allowed: 3 hours<\/p>\n
Part – I<\/strong> While answering questions in this Part, indicate briefly your working and reasoning, wherever required.<\/p>\n Question 1. Question 2. Question 3. (b) The following function is a part of some class which computes and returns the greatest common divisor of any two numbers. There are some places in the code marked by ?1?, ?2?, ?3?, ?4? and ?5? which must be replaced by statement\/expression so that the function works correctly0<\/p>\n (i) What is the expression or statement at ?1? [1] Part – II<\/strong><\/p>\n Answer seven questions in this part, choosing three questions from Section A, two from Section B and two from Section C.<\/p>\n Section – A<\/strong> Question 4. (b) (i) {(C.D)’ + A) + A + C. D + A.B Question 5. Question 6. Question 7. Section – B<\/strong> Question 8. Question 9. (b) The two disadvantages of recursion are: Question 10. Section – C<\/strong> Question 11. Question 12. (b) Stack works on LIFO (Lost In First Out) principle.<\/p>\n Question 13. Write an algorithm OR a Method for deleting a node from a linked list. (b) Best case scenario for an algorithm is the arrangement of data for which the algorithm performs the best, eg., binary search. (c) (i) B D G H F E C A ISC Computer Science Previous Year Question Paper 2011 Solved for Class 12 Maximum Marks: 70 Time allowed: 3 hours Part – I Answer all questions While answering questions in this Part, indicate briefly your working and reasoning, wherever required. Question 1. (a) State the two Absorption laws. Verify any one of them using the truth […]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[41556],"tags":[],"yoast_head":"\n
\nAnswer all questions<\/strong><\/p>\n
\n(a) State the two Absorption laws. Verify any one of them using the truth table. [2]
\n(b) Reduce the following expression: [2]
\nF(A, B, C) = \u03a3 (0, 1, 2, 3, 4, 5, 6, 7)
\nAlso, find the complement of the reduced expression.
\n(c) Name the logic gate for the following circuit diagram and write its truth table. [2]
\n
\n(d) Using truth table, verify whether the following is true or false: [2]
\n\\((p \\Rightarrow q)=(\\overline{q} \\Rightarrow \\overline{p})\\)
\n(e) If A = 1, B = 0, C= 1 and D = 1 find its: [2]
\n(i) Maxterm
\n(ii) Minterm
\nAnswer:
\n
\n
\n<\/p>\n
\n(a) How can we override a method in inheritance? [2]
\n(b) A square matrix A[m*m] is stored in the memory with each element requiring 2 bytes of storage.
\nIf the base address A[1] [1] is 1098 and the address at A [4] [5] is 1144, determine the order of the matrix A[m \u00d7 m] when the matrix is stored Column Major wise. [2]
\n(c) What is Big O notation? [2]
\n(d) What is an exception? [2]
\n(e) Convert the following infix expression to its postfix form: [2]
\na + b * c – d\/e
\nAnswer:
\n(a) When we extend a class, you can change the behaviour of a method in the parent class. This is called method overriding. This happens when we write in a subclass a method that has the same signature as a method in the parent class.
\n(b) B = 1098, W = 2, n = m
\n1144 = 1098 + 2 [m(5 – 1) + (4 – 1)]
\n\u21d2 1144 = 1098 + 8m + 6
\n\u21d2 8m = 40
\n\u21d2 m = 5
\nThe order of the matrix is [5 \u00d7 5]
\n(c) Big O is the function with parameter N, where N is usually the size of the input to the algorithm. More the input size, more impact it can have on the growth rate of the algorithm.
\n(d) An unexpected situation or unexpected error, during program execution, is known as an exception.
\n(e) (a + b * c – d\/e)
\n<\/p>\n
\n(a) The following is a part of some class. What will be the output of the function mymethod( ) when the value of the counter is equal to 3? Show the dry run\/working. [5]<\/p>\nvoid mymethod (int counter)\r\n{\r\nif (counter == 0)\r\nSystem.out. println(\u201d \");\r\nelse\r\n{\r\nSystem.out.println (\"Hello\" +counter);\r\nmymethod (--counter);\r\nSystem.out.println (\" \" +counter);\r\n}\r\n}<\/pre>\n
int gcd(int a, int b)\r\n{\r\nint r.\r\nwhile(?1?)\r\n{\r\nr = ?2?;\r\nb = ?3?;\r\na = ?4?\r\n}\r\nif (a ==0)\r\nreturn ?5?;\r\nelse\r\nreturn-1;\r\n}<\/pre>\n
\n(ii) What is the expression or statement at ?2? [1]
\n(iii) What is the expression or statement at ?3? [1]
\n(iv) What is the expression or statement at ?4? [1]
\n(v) What is the expression or statement at ?5? [1]
\nAnswer:
\n
\n(b) (i) a * b! = 0
\n(ii) b
\n(iii) a
\n(iv) a%b
\n(v) r<\/p>\n
\nAnswer any three questions<\/strong><\/p>\n
\n(a) State the principle of Duality. Give the dual of the following: [3]
\n(A’.B) + (C. 1) = (A’ + C).(B + C)
\n(b) Reduce the Boolean expressions to their simplest forms: [4]
\n(i) {(C.D)’ +A} + A + C.D + A.B
\n(ii) A. {B + C(A.B + A. C)’}
\n(c) Verily using a truth table if: [3]
\n\\((\\mathrm{A} \\odot \\mathrm{B} \\odot \\mathrm{C})^{\\prime}=\\mathrm{A} \\oplus \\mathrm{B} \\oplus \\mathrm{C}\\)
\nAnswer:
\n(a) According to the principle of Duality, “Dual of one expression is obtained by replacing AND (.) with OR (+) and OR with AND togather with replacement of 1 with 0 and 0 with 1.”
\nDual of (A’ . B) + (C.1) is given by (A’ + B). (C + 0) = (A’ + B). C
\nDual of (A’ + C). (B + C) is given by (A’.C) + (B.C)
\nThen Dual of (A’ . B) + (C . 1) = (A’ + C) . (B + C) is (A’ + B). (C + 0) = (A’.C) + (B.C)<\/p>\n
\n= {(C.D)’ + A} + A + AB + C.D
\n= {(C.D)’ + A) + A + C.D [Absorption Law]
\n= (C’ + D’) + A + A + C.D [De Morgan\u2019s Theorem]
\n= C’ + D’ + A + C.D
\n= C’ + C”.D + D’ + A
\n= C’ + D + D’ + A
\n= C’ + A
\n(ii) A. {B + C (A . B + A. C)’}
\n= A {B + C ((A.B)’ . (A.C)’)} [De Morgan\u2019s theorem]
\n= A. {B + C ((A’ + B’). (A\u2019 + C’))} [De Morgan\u2019s theorem]
\n= A. {B + C(A’+B’C’)} [Distributive law]
\n= A. {B + C.A’ + B’.C’.C.}
\n= A. (B + C.A’ +0) [Complement property]
\n= AB + C.A’.A [Complement property]
\n= AB + 0
\n= AB
\n<\/p>\n
\n(a) Given F(P, Q, R, S) = \u03a0 (2, 3, 6, 7, 9, 11, 12, 13, 14, 15) [5]
\nReduce the above expression by using four variable Karnaugh’s Map. Draw the logic gate diagram of the reduced expression using NOR gate only.
\n\\(\\text { (b) Given } \\mathbf{F}(\\mathbf{A}, \\mathbf{B}, \\mathbf{C}, \\mathbf{D})=\\overline{\\mathbf{A}} \\overline{\\mathbf{B}} \\overline{\\mathbf{C}} \\overline{\\mathbf{D}}+\\overline{\\mathbf{A}} \\overline{\\mathbf{B}} \\overline{\\mathbf{C}} \\mathbf{D}+\\mathbf{A} \\overline{\\mathbf{B}} \\overline{\\mathbf{C}} \\overline{\\mathbf{D}}+\\mathbf{A} \\overline{\\mathbf{B}} \\overline{\\mathbf{C}} \\mathbf{D}+\\overline{\\mathbf{A}} \\mathbf{B} \\overline{\\mathbf{C}} \\overline{\\mathbf{D}}+\\overline{\\mathbf{A}} \\mathbf{B} \\mathbf{C} \\overline{\\mathbf{D}}\\)
\nReduce the above expression by using four variable Karnaugh\u2019s Map. Draw the logic gate diagram of the reduced expression using NAND gate only. [5]
\nAnswer:
\n(a) F (P, Q, R, S) = \u03a0 (2, 3, 6, 7, 9, 11, 12, 13, 14, 15)
\n
\n
\n<\/p>\n
\n(a) Show with the help of a logic diagram how a NAND gate is equivalent to an OR gate. [3]
\n(b) Verify if the following is valid: [3]
\n(a => b)^(a => c) = a => (b ^ c)
\n(c) What is a Decoder? Draw the truth table and logic circuit diagram for a 2 to 4 Decoder. [4]
\nAnswer:
\n
\n<\/p>\n
\n(a) What is Full Adder? Draw the truth table for a Full adder. Also, derive SOP expression for the Full Adder and draw its logic circuit. [4]
\n(b) State how a Decoder is different from a Multiplexer. Also, state one use of each. [3]
\n(c) Convert the following cardinal expression into its canonical form and reduce it using Boolean laws: [3]
\nF(L, M, O, P) = \u03a0 (0, 2, 8, 10)
\nAnswer:
\n(a) A full adder is a logic circuit that can add three bits at a time producing two outputs one of which is the Sum bit and the other is Carry bit.
\n
\n(b) A Multiplexer is a circuit that selects one of many input channels and connects it to the output channel. Whereas a decoder is a circuit tan converts binary numbers to denary numbers
\nA multiplexer is used as a common bus system. Whereas a decoder is used in converting binary to denary.
\n<\/p>\n
\nAnswer any two questions<\/strong><\/p>\n\n
\nInput a sentence from the user and count the number of times, the words “an” and “and” are present in the sentence. Design a class Frequency using the description given below: [ 10]
\nClass name: Frequency
\nData members\/variables:
\ntext: stores the sentence
\ncountand: to store the frequency of the word “and”
\ncountan: to store the frequency of the word “an”
\nlen: stores the length of the string
\nMember functions\/methods:
\nFrequency(): constructor to initialize the instance variables
\nvoid accept(String n): to assign n to text, where the value of the parameter n should be in lower case.
\nvoid checkandfreq(): to count the frequency of “and”
\nvoid checkanfreq(): to count the frequency of “an”
\nvoid display(): to display the number of “and” and “an” with appropriate messages.
\nSpecify the class Frequency giving details of the constructor(), void accepts(String), void checkandfreq(), void checkanfreq() and void display(). Also, define the main() function to create an object and call methods accordingly to enable the task.
\nAnswer:<\/p>\nClass frequency\r\n{\r\nString text;\r\nPublic int countand;\r\nPublic int countan:\r\nPublic int len;\r\nFrequency()\r\n{\r\ntext = \"countand = 0;\r\ncountan = 0:\r\nlen = 0;\r\n}\r\nvoid accept(String n)\r\n{\r\nn = text:\r\n}\r\nvoid check and freq()\r\n{ String S = \" \"; countand = 0 ;\r\nlen = n. length();\r\nfor (int i = 0; i < len; i++)\r\n{\r\nchar b = n. charAt(i);\r\nif(b = = ' ')\r\n{\r\nif (S = = \"and'')\r\n{\r\ncountand = countand + 1;\r\n}\r\nS = \" \";\r\n}\r\nelse\r\nS = S+b;\r\n}\r\n}\r\n}\r\nvoid checkanfreq()\r\n{\r\nString S1 = \" \";\r\ncountan = 0;\r\nlen = n. length ( )\r\nfor (int i = 0; i < n; i++)\r\n{\r\nchar b = n.charAt(i);\r\nif (b = = ' ');\r\n{\r\nif (S1 == \"an\")\r\n{\r\ncountan = countan + 1;\r\n}\r\nS1 = \" \";\r\n}\r\nelse\r\n{\r\nS1 = S1 +b;\r\n}\r\n}\r\n}\r\nvoid display()\r\n{\r\nSystem.out pri nl n(' 'Frequency of'and' in the sentence is'' + countand);\r\nSystem.out.println(''Frequency of 'an' in the sentence is'' + countan);\r\n}<\/pre>\n
\nA class DeciOct has been defined to convert a decimal number into its equivalent octal number. Some of the members of the class are given below:
\nClass name: DeciOct
\nData members\/instance variables:
\nn: stores the decimal number
\noct: stores the octal equivalent number
\nMember functions:
\nDeciOct(): constructor to initialize the data members
\nn = 0, oct = 0.
\nvoid getnum(int nn): assign nn to n
\nvoid deci_oct(): calculates the octal equivalent of ‘n’ and stores it in oct using the recursive technique
\nvoid show(): displays the decimal number ‘n’, calls the function deci_oct() and displays its octal equivalent.
\n(a) Specify the class DeciOct, giving details of the constructor( ), void getnum(int), void deci_oct( ) and void show(). Also define a main() function to create an object and call the functions accordingly to enable the task. [8]
\n(b) State any two disadvantages of using recursion. [2]
\nAnswer:<\/p>\n(a) Class DeciOct\r\n{\r\nPublic int n ;\r\nPublic int oct;\r\nDeciOct()\r\n{\r\nn = 0;\r\nOct = 0;\r\n}\r\nvoid getnum.(int nn)\r\n{\r\nn = nn;\r\n}\r\nvoid deci_oct( )\r\n{\r\nint t = n;\r\nint r = 0;\r\nint s;\r\nwhile (t! = 0)\r\n{\r\ns = t % 8;\r\nr = 10 * r + s;\r\n}\r\nOct = 0;\r\nwhile (r! = 0)\r\n{\r\nint p = r% 10\r\nOct = 10 * Oct + p;\r\nr = r\/10;\r\n}\r\n}\r\nvoid show( )\r\n{\r\nSystem.out.println ('' The decimal number is \" + n);\r\nSystem.out.println (\"The octal of \"+ n + \" is\" + oct);\r\n}<\/pre>\n
\n(i) It takes more time to compile.
\n(ii) Much memory blocks are wasted.<\/p>\n(c) input java. io. *;\r\nclass abc\r\n{\r\npublic static void main (String args [ ]) throws IO Exception\r\n{\r\nfrequency ob = new frequency( );\r\nBufferedReader B = new BufferedReader (new InputStream - Reader (System.in));\r\nString p = B.readLine( )\r\nOb.accept(p);\r\nOb.checkandfreq( );\r\nOb.checkanfreq( );\r\nOb.display( );\r\n}\r\n}<\/pre>\n
\nYou are given a sequence of N integers, which are called as pseudo arithmetic sequences [10]
\n(sequences that are in arithmetic progression).
\nSequence of N integers : 2, 5, 6, 8, 9, 12
\nWe observe that 2 + 12 = 5 + 9 = 6 + 8 = 14
\nThe sum of.the above sequence can be calculated as 14 \u00d7 3 = 42.
\nFor sequence containing an odd number of elements the rule is to double the middle element,
\nfor example 2, 5, 7, 9, 12 = 2 + 12 = 5 + 9 = 7 + 7 = 14.
\n14 \u00d7 3 = 42 [middle element = 7]
\nA class Pseudoarithmetic determines whether a given sequence is a pseudo-arithmetic sequence.
\nThe details of the class are given below:
\nClass name: Pseudoarithmetic
\nData members\/instance variables:
\nn: to store the size of the sequence
\na[]: integer array to store the sequence of numbers
\nans, flag: store the status
\nsum: store the sum of the sequence of numbers
\nr: store the sum of the two numbers
\nMember functions:
\nPseudoarithmetic(): default constructor
\nvoid accept(int nn): to assign nn to n and to create an integer array. Fill in the elements of the array
\nboolean check(): return true if the sequence is a pseudo arithmetic sequence otherwise returns false
\nSpecify the class Pseudoarithmetic, giving the details of the constructor(), void accept(int) and boolean check(). Also, define a main() function to create an object and call the member functions accordingly to enable the task.
\nAnswer:<\/p>\nimport java.io. *\r\nclas Pseudoarithmetic\r\n{\r\nPublic int n;\r\nPublic int a [ ];\r\nPublic int ans;\r\nPublic int flag;\r\nPublic int sum;\r\nPublic int r;\r\nPseudoarithmetic()\r\n{\r\nn = 0; flag = 0; sum = 0;\r\n}\r\nvoid accept(int nn)\r\n{\r\nn = nn;\r\nBufferedReader B = new BufferedReaderf new InputStreamReader (System, in));\r\na [n];\r\n(int i = 0; i < n; i++)\r\n{\r\na [i] = Integer.parselnt (B.readLine( ));\r\nsum = sum + a[i];\r\n}\r\n}\r\nboolean check( )\r\n{\r\nif(n%2 = = 0)\r\n{ int i = 0;p = n-1;\r\nwhile (i < p)\r\n{\r\nr = a[i] + a[p]\r\nif (r == (a [i + 1] + a [p - 1] && (r*3) = = sum)\r\n{\r\nflag = 0;\r\n}\r\np = p-1;i = i + 1;\r\nelse\r\nelse if (n%2 ! = 0)\r\n{\r\nint i = 0;p = n-1;\r\nwhile (i <=p)\r\n{\r\nr=a[i] + a[p]\r\nif (r== (a [i +1] + a[p -1]) && (r*3) = = sum)\r\n{\r\nflag = 0;\r\n}\r\nelse\r\n{\r\nflag= 1;\r\n}\r\np = p-1;i = i+1;\r\n}\r\n}\r\nif(flag = = 0)\r\nreturn true;\r\nelse\r\nreturn false;\r\n}<\/pre>\n
\nAnswer any two questions<\/strong><\/p>\n\n
\nA superclass Record has been defined to store the names and ranks of 50 students. Define a sub-class Rank to find the highest rank along with the name. The details of both classes are given below: [10]
\nClass name: Record
\nData members\/instance variables:
\nname[]: to store the names of students
\nmk[]: to store the ranks of students
\nMember functions:
\nRecord(): constructor to initialize data members
\nvoid readvalues(): to store the names and ranks
\nvoid display(): displays the names and the corresponding ranks
\nClass name: Rank
\nData members\/instance variables:
\nindex: integer to store the index of the topmost rank
\nMember functions:
\nRank(): constructor to invoke the base class constructor and to initialize index = 0
\nvoid highest(): finds the index\/location of the topmost rank and stores it in the index without sorting the array.
\nvoid display(): displays the names and rank along with the name haring the topmost rank.
\nSpecific the class Record giving details of the constructor(), void readvalues( ) and void display (). Using the concept of inheritance, specify the class Rank giving details of constructor ( ), void highest() and void display().
\nTHE MAIN() FUNCTION AND ALGORITHM NEED NOT BE WRITTEN.
\nAnswer:<\/p>\nimport java. io. *;\r\nClass Record\r\n{\r\nPublic String name [50];\r\nPublic int rank [50];\r\nRecord()\r\n{\r\nname[] = { };\r\nmk[] = { };\r\n}\r\nvoid readvalues( )\r\n{\r\nBufferedReader B = new BuiferedReader (new InputStieamReader(systeni.in));\r\nfor (int i = 0; i < 50; i++)\r\n{\r\nSystem.out.println(\"Enter name and corresponding rank);\r\nname[i| = B.readLine( );\r\nmk[i] = Integer.parselnt (B.readLine());\r\n}\r\nvoiddisplay( )\r\n{\r\nSystem.out.println(\"The names and corresponding ranks are : \");\r\nfor(int i = 0; i < 50; i++)\r\n{\r\nSystem.out.println(name[i] +\" ''+mk[i]);\r\n}\r\n}\r\nClass Rank extends Record\r\n{\r\nPublic int index;\r\nRank( )\r\n{\r\nsuper.Record( );\r\nindex=0;\r\n}\r\nvoid highest()\r\n{\r\nindex;\r\nint a = 0;\r\nfor(int i = 0; i < 50; i++)\r\n{\r\nfor(int j = 0; j < 50; j++)\r\n{\r\nif (mk [i] < mk [j])\r\n{\r\nindex = i;\r\n}\r\n}\r\n}\r\n}\r\nvoid display()\r\n{\r\nSuper.display( );\r\nSystem.out.println (\"The Topmost rank activer is \" + name [index] + \" \"+ mk [index]); .\r\n}<\/pre>\n
\nA stack is a kind of data structure which can store elements with the restriction that an element can be added or removed from the top only.
\nThe details of the class Stack is given below:
\nClass name: Stack
\nData members\/instance variables:
\nst[]: the array to hold the names
\nsize: the maximum capacity of the string array
\ntop: the index of the topmost element of the stack
\nctr: to count the number of elements of the stack
\nMember functions:
\nStack( ): default constructor
\nStack(int cap): constructor to initialize size = cap and top = -1
\nvoid pushname(String n): to push a name onto the stack. If the stack is full, display the message “OVERFLOW”
\nString popname(): removes a name from the top of the stack and returns it. If the stack is empty, display the message “UNDERFLOW”
\nvoid display(): Display the elements of the stack.
\n(a) Specify class Stack giving details of the constructors(), void pushname(String n), String popname() and void display(). [8]
\nTHE MAIN() FUNCTION AND ALGORITHM NEED NOT BE WRITTEN.
\n(b) Under what Principle does the above entity work?
\nAnswer:<\/p>\n(a) Class Stack\r\n{\r\nString ST [ ];\r\nint size;\r\nint top;\r\nint etr;\r\nStack( )\r\n{\r\nfor(int i = 0; i <10; i++) \r\nSt [i] = \" \"; \r\nsize = 0; \r\ntop = 0; \r\nctr = 0; \r\nStack(int cap) \r\n{ \r\nsize = cap \r\nSt [size]; \r\ntop = -1 ; \r\nvoid pushname (String n) \r\n{ \r\nif (top = = (size - 1)) \r\nSystem.out.println (''overflow''); \r\nelse \r\n{ \r\ntop ++; \r\nSt [top] = n; \r\n} \r\n} \r\nString popname( ) \r\n{ \r\nString v; \r\nif(top = = -1) \r\nSystem.out.println(''underflow \"); \r\nelse \r\n{ \r\nv = St[top]; \r\nSystem.out.println(\"poped element is''+'' : \" + v); \r\ntop--; \r\n} \r\n} \r\nvoid display \r\n{ \r\nif(top == -1) \r\nSystem.out.println(''empty''); \r\nelse \r\n{ \r\nfor (int i = top-1; i > = 0 ; i--)\r\n{\r\nSystem.out.println(St [i]):\r\n}\r\n}\r\n}<\/pre>\n
\n(a) A linked list is formed from the objects of the class, [4]<\/p>\nclass Node\r\n{\r\ninto info;\r\nNode link;\r\n}<\/pre>\n
\nThe method declaration is given below :
\nvoid delete node (Node start)
\n(b) Distinguish between worst-case and best-case complexity of an algorithm. [2]
\n(c) Answer the following from the diagram of a Binary Tree given below:
\n
\n(i) Write the Postorder tree traversal. [1]
\n(ii) Name the Leaves of the tree. [1]
\n(iii) Height of the tree. [1]
\n(iv) Root of the tree. [1]
\nAnswer:
\n(a) Algorithm
\n(i) Copy the content of the next mode into the mode that has to be deleted.
\n(ii) Assign the next pointer of the newly copied node of the next pointer of the node from the content has been copied.
\n(iii) Delete the node from the data has copied.<\/p>\n
\nThe worst-case scenario, on the other hand, describes the absolute worst set of input for a given algorithm, e.g., quicksort.<\/p>\n
\n(ii) B, D, G, H
\n(iii) 5
\n(iv) A<\/p>\nISC Class 12 Computer Science Previous Year Question Papers<\/a><\/h4>\n","protected":false},"excerpt":{"rendered":"