{"id":47367,"date":"2019-08-28T14:54:51","date_gmt":"2019-08-28T09:24:51","guid":{"rendered":"https:\/\/cbselibrary.com\/?p=47367"},"modified":"2020-12-14T11:05:14","modified_gmt":"2020-12-14T05:35:14","slug":"isc-class-12-computer-science-previous-year-question-papers-solved-2013","status":"publish","type":"post","link":"https:\/\/cbselibrary.com\/isc-class-12-computer-science-previous-year-question-papers-solved-2013\/","title":{"rendered":"ISC Computer Science Question Paper 2013 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. (b) F = (A + B’).(B + CD)’ (c) F(P, Q, R) = \u03c0(1, 3) (d) (~p => q) \u2227 p = (p \u2227 ~q) \u2228 (p \u2227 q) (e) (i) (A’ + 1).B = (0 + 1). 0 = 0 Question 2. (b) E * (F\/(G-H) * I) +J (c) Step 1: Start (d) (i) FileOutputStream\/DataOutputStream\/FileWriter\/OutputStream (e) Row Major address formula: Question 3. (b) The following function is a part of some class. Assume \u2018n\u2019 is a positive integer. Answer the given questions along with dry run \/ working,<\/p>\n (i) What will be returned by unknown(5)? [2] 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. Question 5. (In all of the above cases 1 indicates yes and 0 indicates no) Question 6. Question 7. Section – B<\/strong> Question 8. Question 9. Question 10. Section – C <\/strong><\/p>\n Question 11. Class name: Perimeter Question 12. Question 13. Write an Algorithm OR a Method to count the number of nodes in the linked list. The method declaration is given below: (ii) How would the complexity change if all the loops went up to the same limit N? (b) (i) O(N \u00d7 M) + O(X) OR O(NM + X) ISC Computer Science Previous Year Question Paper 2013 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 Principle of Duality. Write the dual of: [2] (P + Q’).R.1 … Read more<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[41556],"tags":[],"yoast_head":"\n
\nAnswer all questions<\/strong><\/p>\n
\n(a) State the Principle of Duality. Write the dual of: [2]
\n(P + Q’).R.1 = P.R + Q’.R
\n(b) Minimize the expression using Boolean laws: [2]
\nF = (A + B’)(B + CD)’
\n(c) Convert the following cardinal form of expression into its canonical form: [2]
\nF (P, Q, R) = \u03c0 (1, 3)
\n(d) Using a truth table verify: [2]
\n(~p => q) \u2227 p = (p \u2227 ~q) \u2228 (p \u2227 q)
\n(e) If A = 1 and B = 0, then find: [2]
\n(i) (A’ + 1).B
\n(ii) (A + B7
\nAnswer:
\n(a) To every Boolean equation there exists another equation which is dual to the previous equation. This is done by changing AND\u2019s to OR\u2019s and vice-versa, 0\u2019s to Fs and vice-versa, complements remain unchanged.
\nDual: (P.Q’) + R + 0 = (P + R). (Q’+ R)<\/p>\n
\nF = (A + B’). (B’. (CD)’)
\nF = AB’+B’B’.(C’+D’)
\nF = B’.(C’+D’)<\/p>\n
\n= 001, 011
\n= (P + Q + R’).(P + Q’ + R’)<\/p>\n
\n<\/p>\n
\n(ii) (A+B’)’ = (1 + 1)’ = (1)’ = 0<\/p>\n
\n(a) Differentiate between throw and throws with respect to exception handling. [2]
\n(b) Convert the following infix notation to its postfix form: [2]
\nE*(F\/(G-H)*I) + J
\n(c) Write the algorithm for push operation (to add elements) in an array based stack. [2]
\n(d) Name the File Stream classes to: [2]
\n(i) Write data to a file in binary form.
\n(ii) Read data from a file in text form.
\n(e) A square matrix M [ ] [ ] of size 10 is stored in the memory’ with each element requiring 4 bytes of storage. If the base address at M [0][0] is 1840, determine the address at M [4] [8] when the matrix is stored in Row Major Wise. [2]
\nAnswer:
\n(a) Throw: This clause is used to explicitly raise a exception within the program, the statement would throw new exception.
\nThrows: This clause is used to indicate the exception that are not handled by the method.<\/p>\n
\n= E*(F\/GH- *I) + J
\n= E * FGH-\/I * + J
\n= EFGH-\/I**J +<\/p>\n
\nStep 2: if top >= capacity then OVERFLOW, Exit
\nStep 3: top = top+1
\nStep 4: Stack [top] = value
\nStep 5: Stop<\/p>\n
\n(ii) FileReader \/ DatalnputStream\/ InputStream\/ FilelnputStream<\/p>\n
\nM[i] [j] = BA+W [(i – Ir) * column + (j – Ic)]
\nBA: 1840, Ir = 0, Ic = 0, W = 4, rows = 10, column = 10, i = 4, j = 8
\nM[4] [8] = 1840 + 4 [(4 – 0) \u00d7 10+ (8 – 0)]
\n= 1840 + 192
\n= 2032<\/p>\n
\n(a) The following function Recur is a part of some class. What will be the output of the function Recur () when the value of n is equal to 10. Show the dry run \/ working. [5]<\/p>\nvoid Recur (int n)\r\n{\r\nif (n>1)\r\n{\r\nSystem.out.print (n + \" \" );\r\nif(n%2 !=0)\r\n{\r\nn = 3* n + 1;\r\nSystem.out.print(n + \" \");\r\n}\r\nRecur (n\/2);\r\n}\r\n}<\/pre>\n
int unknown (int n)\r\n{\r\nint i, k;\r\nif (n%2 = = 0)\r\n{\r\ni = n\/2; k=1;\r\n}\r\nelse\r\n{\r\nk=n;\r\nn--;\r\ni=n\/2;\r\n}\r\nwhile (i > 0)\r\n{\r\nk=k*i*n;\r\ni--;\r\nn--;\r\n}\r\nreturn k;\r\n}<\/pre>\n
\n(ii) What will be returned by unknown(6)? [2]
\n(iii) What is being computed by unknown (int n)? [1]
\nAnswer:
\n(a) Recur (10)
\n10 Recur (5)
\n5
\n16 Recur (8)
\n8 Recur (4)
\n4 Recur (2)
\n2 Recur (1)
\nOUTPUT: 10 5 16 8 4 2
\n(b) (i) 120
\n(ii) 720
\n(iii) calculate factorial\/ product<\/p>\n
\nAnswer any three questions<\/strong><\/p>\n
\n(a) Given the Boolean function: F(A, B, C, D) = \u03a3 (0, 2, 4, 5, 8, 9, 10, 12, 13)
\n(i) Reduce the above expression by using 4-variable K-Map, showing the various groups (i.e. octal, quads and pairs). [4]
\n(ii) Draw the logic gate diagram of the reduced expression. Assume that the variables and their complements are available as inputs. [ 1]
\n(b) Given the Boolean function : F(P, Q, R, S) = \u03a0 (0, 1, 3, 5, 7, 8, 9, 10, 11, 14, 15)
\n(i) Reduce the above expression by using 4-variable K-Map, showing the various groups (i.e. octal, quads and pairs). [4]
\n(ii) Draw the logic gate diagram of the reduced expression. Assume that the variables and their complements are available as inputs. [1]
\nAnswer:
\n(a) F(A, B, C, D) = \u03a3 (0, 2, 4, 5, 8, 9, 10, 12, 13)
\n
\n
\n<\/p>\n
\nA Football Association coach analyzes the criteria for a win\/draw of his team depending on the following conditions:
\nIf the Centre and Forward players perform well but Defenders do not perform well.
\nor
\nIf Goalkeeper and Defenders perform well but the Centre players do not perform well.
\nor
\nIf all the players perform well.
\nThe inputs are:<\/p>\n\n\n
\n Inputs<\/strong><\/td>\n <\/td>\n<\/tr>\n \n C<\/td>\n Centre players perform well.<\/td>\n<\/tr>\n \n D<\/td>\n Defenders perform well.<\/td>\n<\/tr>\n \n F<\/td>\n Forward players perform well.<\/td>\n<\/tr>\n \n G<\/td>\n Goalkeeper performs well.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\nOutput: X – Denotes the win\/draw criteria [1 indicates win\/draw and 0 indicates defeat in all cases.]
\n(a) Draw the truth table for the inputs and outputs given above and write the POS expression for X(C, D, F, G). [5]
\n(b) Reduce X(C, D, F, G) using Karnaugh\u2019s Map.
\nDraw the logic gate diagram for the reduced POS expression for X (C, D, F, G ) using AND and OR gate. You may use gates with two or more inputs. Assume that the variable and their complements are available as inputs. [5]
\nAnswer:
\n
\n<\/p>\n
\n(a) In the following truth table, x and y are inputs and B and D are outputs: [3]
\n
\nAnswer the following questions:
\n(i) Write the SOP expression for D.
\n(ii) Write the POS expression for B.
\n(iii) Draw a logic diagram for the SOP expression derived for D, using only NAND gates.
\n(b) Using a truth table, verify if the following proposition is valid or invalid:
\n(a =>b) \u2227 (b =>c) = (a =>c) [3]
\n(c) From the logic circuit diagram given below, name the outputs (1), (2) and (3). Finally, derive the Boolean expression and simplify it to show that it represents a logic gate. Name and draw the logic gate. [4]
\n
\nAnswer:
\n
\n<\/p>\n
\n(a) What are Decoders? How are they different from Encoders? [2]
\n(b) Draw the truth table and a logic gate diagram for a 2 to 4 Decoder and briefly explain its working. [4]
\n(c) A combinational logic circuit with three inputs P, Q, R produces output 1 if and only if an odd number of 0\u2019s are inputs. [4]
\n(i) Draw its truth table.
\n(ii) Derive a canonical SOP expression for the above truth table.
\n(iii) Find the complement of the above-derived expression using De Morgan\u2019s theorem and verify if it is equivalent to its POS expression.
\nAnswer:
\n(a) Decoders are a combinational circuit which inputs \u2018n\u2019 lines and outputs 2n or fewer lines. Encoders convert HLL to LLL i.e. Octal, Decimal and Hexadecimal to binary whereas Decoders convert LLL to HLL i.e. Binary to Octal, Decimal and Hexadecimal.
\n
\nWorking: If any number is required as output then the inputs should be the binary equivalent. For example, if the input is 01 (A’.B) then the output is 1 and so on.
\n
\n(ii) X (P, Q, R) = P’Q’R’ + P’QR + PQ’R + PQR’
\n(iii) Complement of X (P, Q, R) = (P + Q + R). (P + Q’ + R’). (P’ + Q + R’). (P’ + Q’ + R) which is not equal to POS expression for the above Truth Table.<\/p>\n
\nAnswer any two questions<\/strong><\/p>\n\n
\nAn emirp number is a number which is prime backwards and forwards. Example: 13 and 31 are both prime numbers. Thus, 13 is an emirp number. [10]
\nDesign a class Emirp to check if a given number is Emirp number or not. Some of the members of the class are given below:
\nClass name: Emirp
\nData members\/instance variables:
\nn: stores the number
\nrev: stores the reverse of the number
\nf: stores the divisor
\nMember functions:
\nEmirp(int nn): to assign n = nn, rev = 0 and f = 2
\nint isprime(int x): check if the number is prime using the recursive technique and return 1 if prime otherwise return 0
\nvoid isEmirp(): reverse the given number and check if both the original number and the reverse number are prime, by invoking the function isprime(int) and display the result with an appropriate message
\nSpecify the class Emirp giving details of the constructor(int), int isprime (int) and void isEmirp(). Define the main function to create an object and call the methods to check for Emirp number.
\nAnswer:<\/p>\nimport java.util. Scanner;\r\npublic class Emirp\r\n{\r\nint n,rev,f;\r\nEmirpfint nn)\r\n{\r\nn=nn;\r\nrev=0;\r\nf=2;\r\n}\r\nintisprime(int x)\r\n{\r\nif(n==x)\r\n{\r\nreturn 1;\r\n}\r\nelse if (n%x = = 0 ||n == 1)\r\n{\r\nreturn 0;\r\n}\r\nelse\r\nreturn isprime(x+1);\r\n}\r\nvoid isEmirp()\r\n{\r\nint x=n;\r\nwhile(x!=0)\r\n{\r\nrev=(rev* 10) + x%10;\r\nx=x\/10;\r\n}\r\nint ans1=isprime(f);\r\nn=rev;\r\nf=2;\r\nint ans2=isprime(f);\r\nif(ans 1 ==1 && ans2==1)\r\nSystem. out.println(n+\" is anEmirp number\");\r\nelse\r\nSystem.out.println(n+\" is not an Emirp number\");\r\n}\r\npublic static void main()\r\n{\r\nScanner sc=new Scanner(System.in);\r\nSystem.out.println(\"\\n Enter a number\");\r\nint x=sc.nextInt();\r\nEmirp obj = new Emirp(x);\r\nobj.isEmirp();\r\n}\r\n}<\/pre>\n
\nDesign a class Exchange to accept a sentence and interchange the first alphabet with the last alphabet for each word in the sentence, with single-letter word remaining unchanged. The words in the input sentence are separated by a single blank space and terminated by a full stop. [10]
\nExample:
\nInput: It is a warm day.
\nOutput: tI si a mraw yad
\nSome of the data members and member functions are given below:
\nClass name: Exchange
\nData members\/instance variables:
\nsent: stores the sentence
\nrev: to store the new sentence
\nsize: stores the length of the sentence
\nMember functions:
\nExchange(): default constructor
\nvoid readsentence(): to accept the sentence
\nvoid exfirstlast(): extract each word and interchange the first and last alphabet of the word and form a new sentence rev using the changed words
\nvoid display(): display the original sentence along with the new changed sentence.
\nSpecify the class Exchange giving details of the constructor ( ), void readsentence (), void exfirstlast () and void display (). Define the main () function to create an object and call the functions accordingly to enable the task.
\nAnswer:<\/p>\nimportjava.util.*;\r\npublic class Exchange\r\n{\r\nString sent,rev;\r\nint size;\r\nExchange()\r\n{\r\nsent=null;\r\nrev=\"\";\r\n}\r\nvoid readsentence()\r\n{\r\nScanner sc=new Scanner(System.in);\r\nSystem.out.print(\"\\n Enter a sentence \");\r\nsent=sc.nextLine();\r\nsize=sent.length();\r\n}\r\nvoid exfirstlast()\r\n{\r\nint p=0; char ch; String b;\r\nfor(inti=0;i<size;i++)\r\n{\r\nch=sent.charAt(i);\r\nif(ch==\"||ch =='.\u2019)\r\n{\r\nb=sent. substring(p,i);\r\nif(b.length() != 1)\r\n{\r\nrev += b.qharAt(b.length()-1);\r\nrev = rev + b.substring(l,b.length()-1);\r\nrev += b.charAt(0);\r\n}\r\nelse\r\nrev = rev + b;\r\nrev = rev +\" \";\r\np=i+1;\r\n}\r\n}\r\n}\r\nvoid display()\r\n{\r\nSystem.out.print(\"\\n Input: \" + sent);\r\nSystem.out.print(\"\\n Output:\" + rev);\r\n}\r\npublic static void main()\r\n{\r\nExchange obj = new Exchange();\r\nobj.readsentence();\r\nobj.exfirstlast();\r\nobj. display();\r\n}\r\n}<\/pre>\n
\nA class Matrix contains a two-dimensional integer array of an order [m * n]. The maximum value possible for both \u2018m\u2019 and \u2018n\u2019 is 25. Design a class Matrix to find the difference between the two matrices. The details of the members of the class are given below: [10]
\nClass name: Matrix
\nData members\/instance variables:
\narr[][]: stores the matrix element
\nm: integer to store the number of rows
\nn: integer to store the number of columns
\nMember functions:
\nMatrix (int mm, int nn): to initialize the size of the matrix m = mm and n = nn
\nvoid fillarray(): to enter the elements of the matrix
\nMatrix SubMat(Matrix A): subtract the current object from the matrix of the parameterized object and return the resulting object
\nvoid display(): display the matrix elements
\nSpecify the class Matrix giving details of the constructor(int, int), void fillarray(), Matrix SubMat (Matrix) and void display (). Define the main ( ) function to create objects and call the methods accordingly to enable the task.
\nAnswer:<\/p>\nimport java.util. Scanner;\r\npublic class Matrix\r\n{\r\nstatic Scanner sc=new Scanner(System.in);\r\nint arr[] []=new int[25] [25];\r\nint m,n;\r\nMatrix(int mm, int nn)\r\n{\r\nm=mm;\r\nn=nn;\r\n}\r\nvoidfillarray()\r\n{\r\nSystem.out.print(\"\\n Enter elements of array\");\r\nfor(int i=0;i<m;i++)\r\n{\r\nfor(int j=0;j<n; j++)\r\narr[i] [j]=sc.nextInt();\r\n}\r\n}\r\nMatrix SubMat(Matrix A)\r\n{\r\nMatrix B=new Matrix(m,n);\r\nfor(int i=0;i<m;i++)\r\n{\r\nfor(int j=0;j<n; j++)\r\nBarr[i][j]= arr[i][j] - A.arr[i][j];\r\n}\r\nreturn B;\r\n}\r\nvoid display()\r\n{\r\nfor(int i=0;i<m;i++)\r\n{\r\nSystem.out.println();\r\n{\r\nfor(int j=0;j<n;j++) \r\nSystem, out.print(arr[i][j] +\" \\t\"); \r\n} \r\n} \r\n} \r\npublic static \r\nvoid main() \r\n{ \r\nSystem.out.print(\"\\n Size of array\"); \r\nint x=sc.nextInt(); \r\nint y=sc.nextInt(); \r\nMatrix A=new Matrix(x, y); \r\nMatrix B=new Matrix(x, y); \r\nMatrix C=new Matrix(x, y); \r\nA.fillarray(); \r\nB.fillarray(); \r\nC=A.SubMat(B); C.display(); \r\n} \r\n}<\/pre>\n
\n
\nA superclass Perimeter has been defined to calculate the perimeter of a parallelogram. Define a subclass Area to compute the area of the parallelogram by using the required data members of the superclass. The details are given below: [10]<\/p>\n
\nData members\/instance variables:
\na: to store the length in decimal
\nb: to store the breadth in decimal
\nMember functions:
\nPerimeter (…): parameterized constructor to assign values to data members
\ndouble Calculate(): calculate and return the perimeter of a parallelogram is 2* (length + breadth)
\nvoid show(): to display the data members along with the perimeter of the parallelogram
\nClass name: Area
\nData members\/instance variables:
\nh: to store the height in decimal
\narea: to store the area of the parallelogram
\nMember functions:
\nArea(…): parameterized constructor to assign values to data members of both the classes
\nvoid doarea(): compute the area as (breadth * height)
\nvoid show(): display the data members of both classes along with the area and perimeter of the parallelogram.
\nSpecify the class Perimeter giving details of the constructor (…), double Calculate and void show (). Using the concept of inheritance, specify the class Area giving details of the constructor (…), void doarea () and void show (). The main function and algorithm need not be written.
\nAnswer:<\/p>\nimport java.util.*;\r\nclass Perimeter \r\n{ \r\nprotected double a,b; \r\nPerimeter(double aa, double bb) \r\n{ \r\na=aa; \r\nb=bb; \r\n} \r\ndouble Calculate() \r\n{ \r\nreturn (2*(a+b)); } \r\nvoid show() \r\n{ \r\nSystem.out.print(\"\\n Length = \" + a);\r\nSystem.out.print(\"\\n Breadth = \" + b); \r\nSystem.out.print(\"\\n Perimeter =\" + Calculate()); \r\n} \r\n} \r\nimportjava.util.*; \r\nclass Area extends Perimeter \r\n{ \r\ndouble h; \r\ndouble area; \r\nArea(double aa, double bb, double cc) \r\n{ super(aa, bb); \r\nh=cc; }\r\nvoid doarea() \r\n{ \r\narea=super.b*h; \r\n} \r\nvoid show() \r\n{ super, show(); \r\nSystem, out.print(\"\\n Height = \" + h); \r\nSystem.out.print(\"\\n Area = \" + area); \r\n} \r\n}<\/pre>\n
\nA doubly queue is a linear data structure which enables the user to add and remove integers from either ends, i.e. from front or rear. Define a class Dequeue with the following details: [10]
\nClass name: Dequeue
\nData members\/instance variables:
\narr[ ]: array to hold up to 100 integer elements
\nlim: stores the limit of the dequeue
\nfront: to point to the index of the front end
\nrear: to point to the index of the rear end
\nMember functions:
\nDequeue(int 1): constructor to initialize the data members lim = 1; front = rear = 0
\nvoid addfront(int val): to add integer from the front if possible else display the message (“Overflow from front”) voidaddrear(intval): to add integer from the rear if possible else display the message (“Overflow from rear”)
\nint popfront(): returns element from front, if possible otherwise returns – 9999
\nint poprear(): returns element from rear, if possible otherwise returns – 9999
\nSpecify the class Dequeue giving details of the constructor (int), void addfront(int), void addrear (int, popfront ( ) and int poprear ( ). The main function and algorithm need not be written.
\nAnswer:<\/p>\npublic class Dequeue\r\n{\r\nint arr[] = new int[100];\r\nint lim,front,rear;\r\nDequeue(int 1)\r\n{\r\nlim=1; front=0; rear=0; arr=newint[lim];\r\n}\r\nvoid addfront(int val)\r\n{\r\nif(front>0)\r\narr[front--]=val;\r\nelse\r\nSystem.out.print(\"\\n Overflow from front\");\r\n}\r\nvoid addrear(int val)\r\n{\r\nif(rear<lim-1)\r\narr[++rear]=val;\r\nelse\r\nSystem.out.print(\"\\n Overflow from rear\");\r\n}\r\nint popfront()\r\n{\r\nif(front!=rear)\r\nreturn arr[++front];\r\nelse\r\nreturn -9999;\r\n}\r\nint poprear()\r\n{\r\nif(front!=rear)\r\nreturn arr[rear--];\r\nelse\r\nreturn -9999;\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\nint item;\r\nNode next;\r\n}<\/pre>\n
\nint count (Node ptr-start)
\n(b) What is the Worst Case complexity of the following code segment: [2]<\/p>\n(i) for(int p = 0;p<N;p++)\r\n{\r\nfor (int q=0; q < M; q++)\r\n{\r\nSequence of statements;\r\n}\r\n}\r\nfor(int r=0;r<X;r++)\r\n{\r\nSequence of statements;\r\n}<\/pre>\n
\n(c) Answer the following from the diagram of a Binary Tree is given below:
\n
\n(i) Preorder Transversal of the tree. [1]
\n(ii) Children of node E. [1]
\n(iii) The left subtree of node D. [1]
\n(iv) Height of the tree when the root of the tree is at level 0. [1]
\nAnswer:
\n(a) Algorithm to count the number of nodes in a linked list
\nSteps:
\n1. Start
\n2. Set a temporary pointer to the first node and counter to 0.
\n3. Repeat steps 4 and 5 until the pointer reaches null
\n4. Increment the counter
\n5. move the temporary pointer to the next node
\n6. Return the counter value
\n7. End
\nMethod to count for the number of nodes in a linked list<\/p>\nint count (Node ptr_start)\r\n{\r\nNode a = new Node(ptr_start);\r\nint c=0;\r\nwhile (a!=null)\r\n{\r\nc++;\r\na=a.next;\r\n}\r\nreturn c:\r\n}<\/pre>\n
\n(ii) O( N2) OR O( N2 + N) = O(N2) (by taking the dominant term)
\n(c) (i) A, I, B, C, D, E, G, H, F
\n(ii) G and H
\n(iii) EGH
\n(iv) 4<\/p>\nISC Class 12 Computer Science Previous Year Question Papers<\/a><\/h4>\n","protected":false},"excerpt":{"rendered":"