ISC Computer Science 2010 Class-12 Previous Year Question Paper Solved for practice. Step by step Solutions with Questions of Part-1 and Part-2 (Section-A, B and C). By the practice of Computer Science 2010 Class-12 Solved Previous Year Question Paper you can get the idea of solving. Try Also other year except ISC Computer Science 2010 Class-12 Solved Question Paper […]
The post ISC Computer Science 2010 Class-12 Previous Year Question Papers Solved appeared first on ICSEHELP.
]]>ISC Computer Science 2010 Class-12 Previous Year Question Paper Solved for practice. Step by step Solutions with Questions of Part-1 and Part-2 (Section-A, B and C). By the practice of Computer Science 2010 Class-12 Solved Previous Year Question Paper you can get the idea of solving.
Try Also other year except ISC Computer Science 2010 Class-12 Solved Question Paper of Previous Year for more practice. Because only ISC Computer Science 2010 Class-12 is not enough for complete preparation of next council exam. Visit official website CISCE for detail information about ISC Class-12 Computer Science.
-: Select Your Topics :-
Maximum Marks: 70
Time allowed: 3 hours
Part – I (20 Marks)
Answer all questions.
While answering questions in this Part, indicate briefly your working and reasoning, wherever required.
Question 1.
(a) If X = A’BC + AB’C + ABC + A’BC’ then find the value of X when A = 1; B = 0; C = 1 [2]
(b) Verify if, P. (~ P + Q’) = (P = > Q) using truth table. [2]
(c) Draw the logic circuit of NOR and NAND gate only. [2]
(d) Convert the following function into its Canonical sum of products form: [2]
F(X, Y, Z) = Σ(0, 1, 5, 7).
(e) Show that dual of P’QR’ + PQ’R + P’Q’R is equal to the complement of: [2]
PQ’R + Q. (P’R’+PR’)
Answer 1:
Question 2.
(a) State the difference between an Interface and a Class. [2]
(b) Convert the following infix notation to postfix notation: [2]
(A + B) / C * (D + E)
(c) A character array B[7] [6] has a base address 1046 at 0, 0. Calculate the address at B[2] [3] if the array is stored Column Major wise. Each character requires tw o bytes of storage. [2]
(d) State the use of exceptional handling. Name the two types of exceptions. [2]
(e) (i) What is the worst-case complexity of the follow ing code segment: [2]
for (int i = 0; i < N; i++) { sequence of statements } for (int j=0 ; j < M; j++) { sequence of statements }
(ii) How would the complexity change if the second loop went to N instead of M?
Answer 2:
(a)
(i) Class can be extends in another class.
(ii) Interface is implemented in another class.
(b) (A + B) / (C * (D + E))
= (AB +) / (C * (DE +))
= (AB +) / (CDE + *)
= AB + CDE + */
(c) B + W [(I – LBR) + M (J – LBC)]
= 1046 + 2 [(2 – 0) + 7(3 – 0)]
= 1046 + 2(2 + 21)
= 1046 + 2(23)
= 1046 + 46
= 1092
(d) Exception: It refers to some contradictory or unusal situation which can be encountered while executing a program.
(i) IO Exception
(ii) Array out of Bound Exception
(e)
(i) for (i = 0; i < N ; i + +) This loop gets executed N times thus take time C1 * N
for (i = 0; j < M ; j ++) This loop gets executed M times thus take time C2 * M
Total Time = C1 * N + C2 * M = 0 (N + M)
(ii) It becomes = O(2N)
Question 3.
(a) The following functions numbers (int) and numbers1 (int) are a part of some class. Answer the questions given below showing the dry run/working:
public void numbers (int n) { if (n > 0) { System.out. print(n + " " ); numbers (n-2); System.out.print(n + " "); } } public String numbers1 (int n) { if (n < = 0) return " "; return numbersl(n-1) + n + " "; }
(i) What will be the output of the function numbers (int n) when n = 5? [2] (ii) What will the function numbersl (int n) return when n = 6? [2] (iii) State in one line what is the function numbersl (int) doing apart from recursion? [1] (b) The following function is a part of some class. It sorts the array a[ ] in ascending order using insertion sort technique. There are some places in the code marked by ?1?, ?2?, ?3?, ?4?, ?5? which must be replaced by expression / statement so that the function works correctly.
void insertsort (int a [ ]) { int m = ?1?; int b, i, t; for (i = ?2? ; i < m; i++) { t = a[i]; b = i - I; while (?3? > = 0 && t < a [ b ]) { a[b+1] = a[b]; ?4?; } ?5? = t; } }
(i) What is the expression or statement at ?1? [1]
(ii) What is the expression or statement at ?2? [1]
(iii) What is the expression or statement at ?3? [1]
(iv) What is the expression or statement at ?4? [1]
(v) What is the expression or statement at ?5? [1]
Answer 3:
(a)
(i) 5 3 1 1 3 5
(ii) “1 2 3 4 5 6”
(iii) It display all number from 1 to that number.
(b)
(i) a length
(ii) 1
(iii) b
(iv) b = b – 1;
(v) a[b+1]
Part- II (50 Marks)
Answer six questions in this part, choosing two questions from Section A, two from Section B and two from Section C.
Section – A
Answer any two questions.
Question 4.
(a) Given F(P,Q,R,S) = Σ (0, 2, 5, 7, 8, 10, 11, 13, 14, 15)
(i) Reduce the above expression by using 4 – Variable K-Map, showing the various groups (i.e., octal, quads and pairs). [4]
(ii) Draw the Logic gate diagram of the reduced expression using NAND gate only. [1]
(b) Given F(A, B, C, D) = (A + B + C + D). (A + B + C + D’). (A + B + C’ + D’). (A + B + C’ + D). (A + B’ + C + D’). (A + B’ + C’ + D’). (A’ + B + C + D). (A’ + B + C’ + D).
(i) Reduce the above expression by using 4 – Variable K-Map, showing the various groups (,i.e., octal, quads and pairs). [4]
(ii) Draw the Logic gate diagram of the reduced expression using NOR gate only. [1]
Answer 4:
Question 5.
A Government Institution intends to award a medal to a person who following criteria:
The person should have been an Indian citizen and had lost his/her completed 25 years of service.
OR
The person must be an Indian citizen and has served the nation for a continuous period of 25 years or more but has not lost his/her life in a war.
OR
The person is not an Indian citizen but has taken an active part in activities for the upliftment of the nation.
The inputs are:
A | The person is/was an Indian citizen |
B | Has a continuous service of more than 25 years |
C | Lost his/her life in a war |
D | Taken part in activities for the upliftment of the nation |
Output: X – Denotes eligible for Medal [1 indicates YES and 0 indicates NO in all cases]
(a) Draw the truth table for the inputs and outputs given above and write the POS expression for X (A, B, C, D). [5]
(b) Reduce X (A, B, C, D) using Karnaugh’s Map. [5]
Draw the logic gate diagram for the reduced POS expression for X (A, B, C, D).
You may use gates with two or more inputs. Assume that the variable and their complements are available as inputs.
Answer 5:
Question 6.
(a) What are Maxterms? Convert the following function as a product of Maxterms: [3]
F(P, Q, R) = (P + Q).(P’ + R)
(b) State whether the following expression is a Tautology or Contradiction with the help of Truth Table: [3]
(X⇔Z) . [(X⇒Y). (Y⇒Z)]
(c) What is Multiplexer? Draw the truth table and logic diagram of an 8 : 1 Multiplexer. [4]
Answer 6:
(a) Maxterm It is a sum of all the literals (with or without the bar) within the logic system.
F(P, Q, R) = (P + Q). (P’ + R’)
= (P + Q + RR’). (P’ + QQ’ + R’)
= (P + Q + R).(P + Q + R’).(P’ + Q + R’) ,(P’ + Q’ + R’)
It is neither Tautology nor contradiction.
(c) Multiplexer: It is a combinational circuit that selects binary information from one of many input lines and directs it to a single output line.
Question 7.
(a) Draw the circuit diagram for a 3 to 8 Decoder. [3]
(b) Draw the truth table for a Half Adder. Also, derive a POS expression for the Half Adder and draw its logic circuit. [3]
(c) Simplify the following expression and also draw the circuit/gate for the reduced expression.
[Show the stepwise working along with the laws used.] [4]
F = X.(Y + Z.(X.Y + X.Z)’)
Answer 7:
Section – B
Answer any two questions.
Question 8.
The coordinates of a point P on a two-dimensional plane can be represented by P(x, y) with x as the x-coordinate and y as the y-coordinate. The coordinates of the midpoint of two points P1(x1, y1) and P2(x2, y2) can be calculated as P(x, y) where: [10]
Design a class Point with the following details:
Class name: Point
Data Members/instance variables:
x: stores the x-coordinate
y: stores the y-coordinate
Member functions:
Point (): constructor to initialize x = 0, y = 0
void readpoint (): accepts the coordinates x and y of a point
Point midpoint (Point A, Point B): calculates and returns the midpoint of the two points A and B
void displaypoint (): displays the coordinates of a point
Specify the class Point giving details of the constructor (), member functions void readpoint ( ), Point midpoint (Point, Point) and void displaypoint () along with the main () function to create an object and call the functions accordingly to calculate the midpoint between any two given points.
Answer 8:
import java.io.*; class Point { int x; inty; public Point () { x = 0; y = 0; } public void read point () throws IOException { Buffered Reader br = new BufferedReader(new InputStreamReader(Systemin); System.out.println("Enter the value of x''); x = Integer.parselnt (br. readLine()); System.out.printing'Enter the value of y "); y = Integer.parselnt(br. readLine ( )); } public Point midpoint(Point A, Point B) { x = (A.x+B.x)/2; y = (A.y + B.y)/2; } public void displaypoint() { System.out.println(x); System. out.println(y); } public void main() { Point obj 1 = new Point(); obj1.readpoint(); Point obj 2 = new Point(); obj2.readpoint(); Point obj 3 = new Point(); Point obj4 = obj3.midpoint(obj 1, obj2); obj4.displayPoint(); } }
Question 9.
Input a word in uppercase and check for the position of the first occurring vowel and perform the following operation. [10]
(i) Words that begin with a vowel are concatenated with “Y”.
For example, EUROPE becomes EUROPEY.
(ii) Words that contain a vowel in-between should have the first part from the position of the vowel till the end, followed by the part of the string from beginning till the position of the vowel and is concatenated by “C”.
For example, PROJECT becomes OJECTPRC.
(iii) Words which do not contain a vowel are concatenated with “N”.
For example, SKY becomes SKYN.
Design a class Rearrange using the description of the data members and member functions given below:
Class name: Rearrange
Data Members/instance variables:
Txt: to store a word
Cxt: to store the rearranged word
len: to store the length of the word
Member functions:
Rearrange (): constructor to initialize the instance variables
void readword (): to accept the word input in UPPER CASE
void convert (): converts the word into its changed form and stores it in string Cxt
void display(): displays the original and the changed word
Specify the class Rearrange giving the details of the constructor (), void readword ( ), void convert () and void display (). Define a main () function to create an object and call the function accordingly to enable the task.
Answer 9:
import java.io.*; class Rearrange { String Txt; String Cxt; intLen; public Rearrange () { Txt= " ''; Cxt = '' " ; Len = 0; } public void readword () { BufferedReader br = new BufferedReaderfnew InputStreamReader(Systemin)): System.out.println( "Enter the String"); Txt = br. readLinef); { public void convert)) { String str1 = " ", str 2 = " " ; boolean check = false; char ch1, ch2, ch3; ch1 = Txt char A+(0); if (ch1 == 'A' || ch1 == 'E' || ch1 == T || ch1 == 'O' || ch1 == 'U') { Cxt = Txt + "Y''; } else { for (i = 0; i < Txt. length (); i ++) { ch2 = TxtcharAt (i); if(ch2 ! = 'A' || ch2 ! = 'E' || ch2 ! = 'I' || ch2 ! = 'O' || ch2 ! = 'U') { Strl = str1 + ch2; } else { check = true; for (j = i; j < Txt.length 0; j++) { ch3 = Txt.charAt (j); str2 = str2 + ch3 ; } Str2 = Str2 + "C"; } Cxt=Str2 + Str1; } if (found = = false) { Cxt = Txt + "N"; } } public void display() { System.out.println("The original string is" + Txt); System.out.println(" The new String is"+ Cxt); } public void main() { Rearrange obj = new Rearrange() obj.readword( ); obj.convert( ); obj.display(); } }
Question 10.
Design a class Change to perform string related operations. The details of the class are given below:
Class name: Change
Data Members/instance variables:
str: stores the word
newstr: stores the changed word
len: store the length of the word
Member functions:
Change(): default constructor
void inputword( ): to accept a word
char caseconvert (char ch): converts the case of the character and returns it
void recchange (int): extracts characters using recursive technique and changes its case using caseconvert () and forms a new word
void display (): displays both the words
(a) Specify the class Change, giving details of the Constructor ( ), member functions void inputword (), char caseconvert (char ch), void recchange (int) and void display (). Define the main () function to create an object and call the functions accordingly to enable the above change in the given word. [8]
(b) Differentiate between an infinite and a finite recursion. [2]
Answer 10:
(a) import java.io.*; Class change { String str; String newstr; int len; public change() { str = " " ; newstr = " "; len = 0; } public void inputword() { BufferedReader br = new BufferedReader (new InputStreamReader (System.in)); System.out.println ("Enter the number"); Str=br.readLine(); } public char caseconvert (char ch) { if (ch > = 'A' &&. ch<= 'Z') { ch=(char) ((int) ch + 32); return ch; } if (ch > = 'a' && ch < = 'z') { return (char) ((int) ch - 32); } if (ch = = ' ') return ch; } public void recchange (int a) { if(a<0) return; else recchange (a-1);
(b) Finite recursion has the same stopping condition on which the recursive function does not call itself. Infinite recursion has no stopping condition and hence go on infinitely.
Section – C
Answer any two questions.
Question 11.
A superclass Worker has been defined to store the details of a worker. Define a subclass Wages to compute the monthly wages for the worker. The details/specifications of both the classes are given below:
Class name: Worker
Data Members/instance variables:
Name: to store the name of the worker
Basic: to store the basic pay in decimals
Member functions:
Worker (…): Parameterised constructor to assign values to the instance variables
void display (): display the worker’s details
Class name: Wages
Data Members/instance variables:
hrs: stores the hours worked
rate: stores rate per hour
wage: stores the overall wage of the worker
Member functions:
Wages (…): Parameterised constructor to assign values to the instance variables of both the classes
double overtime (): Calculates and returns the overtime amount as (hours*rate)
void display (): Calculates the wage using the formula wage = overtime amount + Basic pay and displays it along with the other details
Specify the class Worker giving details of the constructor () and void display ( ). Using the concept of inheritance, specify the class Wages giving details of constructor ( ), double-overtime () and void display (). The main () function need not be written.
Answer 11:
importjava.io.*; class worker { String Name; double Basic; public worker (String n, double b) { Name = n; Basic = b; } public void display ( ) { System.out.println (Name); System.out.println (Basic); } } class wages extends worker { int hrs, rate; double wage public wage (string n, double b, int h, int r, double w) { super (n, b); hrs = h; rate = r; wage = w; } public double overtime () { return (hours*rate); } public void display ( ) { super.display (); wage = overtime () + Basic; System.out.prinln(wages); } }
Question 12.
Define a class Repeat which allows the user to add elements from one end (rear) and remove elements from the other end (front) only.
The following details of the class Repeat are given below:
Class name: Repeat
Data Members/instance variables:
st[]: an array to hold a maximum of 100 integer elements
cap: stores the capacity of the array
f: to point the index of the front
r: to point the index of the rear
Member functions:
Repeat (int m): constructor to initialize the data members cap = m, f = 0, r = 0 and to create the integer array
void pushvalue (int v): to add integer from the rear index if possible else display the message (“OVERFLOW”)
int popvalue (): to remove and return element from the front. If array is empty then return -9999
void disp (): Displays the elements present in the list
(a) Specify the class Repeat giving details of the constructor (int), member function void pushvalue (int). int popvalue () and void disp (). The main ( ) function need not be written. [8]
(b) What is the common name of the entity described above? [1]
(c) On what principle does this entity work? [1]
Answer 12:
(a)
import java.io.*; Class Repeat { intan []; int cap, f, r; public Repeat (int m) { cap = m; f=0; r=0; an [ ] = new int[100]; } public void pushvalue (int v) { if (r = = cap) { Systemout.println ("OVERFLOW"); } else if (f = = 0) { f = 1; } else { an [r++] = v; } } public int popvalue ( ) { if (f == 0) { System.out.println (-9999); } elseif(f=r) { f=0; r = 0; } else { return (an [f++]); } } public void display ( ) { for (i = f; i< = r; i ++) System.outprintln (an [ i ]; }
(b) Queue
(c) It works on first in first out Principle(FIFO).
Question 13.
(a) A linked list is formed from the objects of the class, [4]
class ListNodes { int item; ListNodes next; }
Write a method OR an algorithm to compute and return the sum of all integers items stored in the linked list. The method declaration is specified below:
int listsum(ListNodes start);
(b) What is Big ‘O’ notation? State its significance. [2]
(c) Answer the following from the diagram of a Binary Tree given below:
(i) Name the parent of node E. [1]
(ii) Write the postorder tree traversal. [1]
(iii) Write the internal nodes of the tree. [1]
(iv) State the level of the root of the tree. [1]
Answer 13:
(a) Algorithm
Let P be a pointer of type listNodes.
(b) Big ‘O’ notation: It is used to represent the complexity of algorithms e.g. O(n), O(n log n)
Significance: By using this notation one can compare the complexities of algorithms and can select the best algorithms under time or memory limitations.
(c)
(i) C is a parent of E
(ii) Postorder: FGDBHECA
(iii) internal nodes: A B C D E
(iv) level 1
-: End of ISC Computer Science 2010 Class-12 Solved Paper :-
Return to – ISC Class-12 Solved Previous Year Question Paper
Thanks
Please Share with Your Friends
The post ISC Computer Science 2010 Class-12 Previous Year Question Papers Solved appeared first on ICSEHELP.
]]>ISC Computer Science 2011 Class-12 Previous Year Question Paper Solved for practice. Step by step Solutions with Questions of Part-1 and Part-2 (Section-A,B and C). By the practice of Computer Science 2011 Class-12 Solved Previous Year Question Paper you can get the idea of solving. Try Also other year except ISC Computer Science 2011 Class-12 Solved Question Paper of Previous […]
The post ISC Computer Science 2011 Class-12 Previous Year Question Papers Solved appeared first on ICSEHELP.
]]>ISC Computer Science 2011 Class-12 Previous Year Question Paper Solved for practice. Step by step Solutions with Questions of Part-1 and Part-2 (Section-A,B and C). By the practice of Computer Science 2011 Class-12 Solved Previous Year Question Paper you can get the idea of solving.
Try Also other year except ISC Computer Science 2011 Class-12 Solved Question Paper of Previous Year for more practice. Because only ISC Computer Science 2011 Class-12 is not enough for complete preparation of next council exam. Visit official website CISCE for detail information about ISC Class-12 Computer Science.
-: Select Your Topics :-
Maximum Marks: 70
Time allowed: 3 hours
Part – I (20 Marks)
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 table. [2]
(b) Reduce the following expression: [2]
F(A, B, C) = Σ (0, 1, 2, 3, 4, 5, 6, 7)
Also, find the complement of the reduced expression.
(c) Name the logic gate for the following circuit diagram and write its truth table. [2]
(d) Using truth table, verify whether the following is true or false: [2]
(e) If A = 1, B = 0, C= 1 and D = 1 find its: [2]
(i) Maxterm
(ii) Minterm
Answer 1:
Question 2.
(a) How can we override a method in inheritance? [2]
(b) A square matrix A[m*m] is stored in the memory with each element requiring 2 bytes of storage.
If 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 × m] when the matrix is stored Column Major wise. [2]
(c) What is Big O notation? [2]
(d) What is an exception? [2]
(e) Convert the following infix expression to its postfix form: [2]
a + b * c – d/e
Answer 2:
(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.
(b) B = 1098, W = 2, n = m
1144 = 1098 + 2 [m(5 – 1) + (4 – 1)]
⇒ 1144 = 1098 + 8m + 6
⇒ 8m = 40
⇒ m = 5
The order of the matrix is [5 × 5]
(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.
(d) An unexpected situation or unexpected error, during program execution, is known as an exception.
(e) (a + b * c – d/e)
Question 3.
(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]
void mymethod (int counter) { if (counter == 0) System.out. println(” "); else { System.out.println ("Hello" +counter); mymethod (--counter); System.out.println (" " +counter); } }
(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
int gcd(int a, int b) { int r. while(?1?) { r = ?2?; b = ?3?; a = ?4? } if (a ==0) return ?5?; else return-1; }
(i) What is the expression or statement at ?1? [1]
(ii) What is the expression or statement at ?2? [1]
(iii) What is the expression or statement at ?3? [1]
(iv) What is the expression or statement at ?4? [1]
(v) What is the expression or statement at ?5? [1]
Answer 3:
(b) (i) a * b! = 0
(ii) b
(iii) a
(iv) a%b
(v) r
Part- II (50 Marks)
Answer six questions in this part, choosing two questions from Section A, two from Section B and two from Section C.
Section – A
Answer any two questions.
Question 4.
(a) State the principle of Duality. Give the dual of the following: [3]
(A’.B) + (C. 1) = (A’ + C).(B + C)
(b) Reduce the Boolean expressions to their simplest forms: [4]
(i) {(C.D)’ +A} + A + C.D + A.B
(ii) A. {B + C(A.B + A. C)’}
(c) Verily using a truth table if: [3]
Answer 4:
(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.”
Dual of (A’ . B) + (C.1) is given by (A’ + B). (C + 0) = (A’ + B). C
Dual of (A’ + C). (B + C) is given by (A’.C) + (B.C)
Then Dual of (A’ . B) + (C . 1) = (A’ + C) . (B + C) is (A’ + B). (C + 0) = (A’.C) + (B.C)
(b)
(i) {(C.D)’ + A) + A + C. D + A.B
= {(C.D)’ + A} + A + AB + C.D
= {(C.D)’ + A) + A + C.D [Absorption Law]
= (C’ + D’) + A + A + C.D [De Morgan’s Theorem]
= C’ + D’ + A + C.D
= C’ + C”.D + D’ + A
= C’ + D + D’ + A
= C’ + A
(ii) A. {B + C (A . B + A. C)’}
= A {B + C ((A.B)’ . (A.C)’)} [De Morgan’s theorem]
= A. {B + C ((A’ + B’). (A’ + C’))} [De Morgan’s theorem]
= A. {B + C(A’+B’C’)} [Distributive law]
= A. {B + C.A’ + B’.C’.C.}
= A. (B + C.A’ +0) [Complement property]
= AB + C.A’.A [Complement property]
= AB + 0
= AB
Question 5.
(a) Given F(P, Q, R, S) = Π (2, 3, 6, 7, 9, 11, 12, 13, 14, 15) [5]
Reduce the above expression by using four variable Karnaugh’s Map. Draw the logic gate diagram of the reduced expression using NOR gate only.
Reduce the above expression by using four variable Karnaugh’s Map. Draw the logic gate diagram of the reduced expression using NAND gate only. [5]
Answer 5:
(a) F (P, Q, R, S) = Π (2, 3, 6, 7, 9, 11, 12, 13, 14, 15)
Question 6.
(a) Show with the help of a logic diagram how a NAND gate is equivalent to an OR gate. [3]
(b) Verify if the following is valid: [3]
(a => b)^(a => c) = a => (b ^ c)
(c) What is a Decoder? Draw the truth table and logic circuit diagram for a 2 to 4 Decoder. [4]
Answer 6:
Question 7.
(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]
(b) State how a Decoder is different from a Multiplexer. Also, state one use of each. [3]
(c) Convert the following cardinal expression into its canonical form and reduce it using Boolean laws: [3]
F(L, M, O, P) = Π (0, 2, 8, 10)
Answer 7:
(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.
(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
A multiplexer is used as a common bus system. Whereas a decoder is used in converting binary to denary.
Section – B
Answer any two questions.
Question 8.
Input 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]
Class name: Frequency
Data members/variables:
text: stores the sentence
countand: to store the frequency of the word “and”
countan: to store the frequency of the word “an”
len: stores the length of the string
Member functions/methods:
Frequency(): constructor to initialize the instance variables
void accept(String n): to assign n to text, where the value of the parameter n should be in lower case.
void checkandfreq(): to count the frequency of “and”
void checkanfreq(): to count the frequency of “an”
void display(): to display the number of “and” and “an” with appropriate messages.
Specify 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.
Answer 8:
Class frequency { String text; Public int countand; Public int countan: Public int len; Frequency() { text = "countand = 0; countan = 0: len = 0; } void accept(String n) { n = text: } void check and freq() { String S = " "; countand = 0 ; len = n. length(); for (int i = 0; i < len; i++) { char b = n. charAt(i); if(b = = ' ') { if (S = = "and'') { countand = countand + 1; } S = " "; } else S = S+b; } } } void checkanfreq() { String S1 = " "; countan = 0; len = n. length ( ) for (int i = 0; i < n; i++) { char b = n.charAt(i); if (b = = ' '); { if (S1 == "an") { countan = countan + 1; } S1 = " "; } else { S1 = S1 +b; } } } void display() { System.out pri nl n(' 'Frequency of'and' in the sentence is'' + countand); System.out.println(''Frequency of 'an' in the sentence is'' + countan); }
Question 9.
A 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:
Class name: DeciOct
Data members/instance variables:
n: stores the decimal number
oct: stores the octal equivalent number
Member functions:
DeciOct(): constructor to initialize the data members
n = 0, oct = 0.
void getnum(int nn): assign nn to n
void deci_oct(): calculates the octal equivalent of ‘n’ and stores it in oct using the recursive technique
void show(): displays the decimal number ‘n’, calls the function deci_oct() and displays its octal equivalent.
(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]
(b) State any two disadvantages of using recursion. [2]
Answer 9:
(a) Class DeciOct { Public int n ; Public int oct; DeciOct() { n = 0; Oct = 0; } void getnum.(int nn) { n = nn; } void deci_oct( ) { int t = n; int r = 0; int s; while (t! = 0) { s = t % 8; r = 10 * r + s; } Oct = 0; while (r! = 0) { int p = r% 10 Oct = 10 * Oct + p; r = r/10; } } void show( ) { System.out.println ('' The decimal number is " + n); System.out.println ("The octal of "+ n + " is" + oct); }
(b) The two disadvantages of recursion are:
(i) It takes more time to compile.
(ii) Much memory blocks are wasted.
(c) input java. io. *; class abc { public static void main (String args [ ]) throws IO Exception { frequency ob = new frequency( ); BufferedReader B = new BufferedReader (new InputStream - Reader (System.in)); String p = B.readLine( ) Ob.accept(p); Ob.checkandfreq( ); Ob.checkanfreq( ); Ob.display( ); } }
Question 10.
You are given a sequence of N integers, which are called as pseudo arithmetic sequences [10]
(sequences that are in arithmetic progression).
Sequence of N integers : 2, 5, 6, 8, 9, 12
We observe that 2 + 12 = 5 + 9 = 6 + 8 = 14
The sum of.the above sequence can be calculated as 14 × 3 = 42.
For sequence containing an odd number of elements the rule is to double the middle element,
for example 2, 5, 7, 9, 12 = 2 + 12 = 5 + 9 = 7 + 7 = 14.
14 × 3 = 42 [middle element = 7]
A class Pseudoarithmetic determines whether a given sequence is a pseudo-arithmetic sequence.
The details of the class are given below:
Class name: Pseudoarithmetic
Data members/instance variables:
n: to store the size of the sequence
a[]: integer array to store the sequence of numbers
ans, flag: store the status
sum: store the sum of the sequence of numbers
r: store the sum of the two numbers
Member functions:
Pseudoarithmetic(): default constructor
void accept(int nn): to assign nn to n and to create an integer array. Fill in the elements of the array
boolean check(): return true if the sequence is a pseudo arithmetic sequence otherwise returns false
Specify 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.
Answer 10:
import java.io. * clas Pseudoarithmetic { Public int n; Public int a [ ]; Public int ans; Public int flag; Public int sum; Public int r; Pseudoarithmetic() { n = 0; flag = 0; sum = 0; } void accept(int nn) { n = nn; BufferedReader B = new BufferedReaderf new InputStreamReader (System, in)); a [n]; (int i = 0; i < n; i++) { a [i] = Integer.parselnt (B.readLine( )); sum = sum + a[i]; } } boolean check( ) { if(n%2 = = 0) { int i = 0;p = n-1; while (i < p) { r = a[i] + a[p] if (r == (a [i + 1] + a [p - 1] && (r*3) = = sum) { flag = 0; } p = p-1;i = i + 1; else else if (n%2 ! = 0) { int i = 0;p = n-1; while (i <=p) { r=a[i] + a[p] if (r== (a [i +1] + a[p -1]) && (r*3) = = sum) { flag = 0; } else { flag= 1; } p = p-1;i = i+1; } } if(flag = = 0) return true; else return false; }
Section – C
Answer any two questions.
Question 11.
A 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]
Class name: Record
Data members/instance variables:
name[]: to store the names of students
mk[]: to store the ranks of students
Member functions:
Record(): constructor to initialize data members
void readvalues(): to store the names and ranks
void display(): displays the names and the corresponding ranks
Class name: Rank
Data members/instance variables:
index: integer to store the index of the topmost rank
Member functions:
Rank(): constructor to invoke the base class constructor and to initialize index = 0
void highest(): finds the index/location of the topmost rank and stores it in the index without sorting the array.
void display(): displays the names and rank along with the name haring the topmost rank.
Specific 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().
THE MAIN() FUNCTION AND ALGORITHM NEED NOT BE WRITTEN.
Answer 11:
import java. io. *; Class Record { Public String name [50]; Public int rank [50]; Record() { name[] = { }; mk[] = { }; } void readvalues( ) { BufferedReader B = new BuiferedReader (new InputStieamReader(systeni.in)); for (int i = 0; i < 50; i++) { System.out.println("Enter name and corresponding rank); name[i| = B.readLine( ); mk[i] = Integer.parselnt (B.readLine()); } voiddisplay( ) { System.out.println("The names and corresponding ranks are : "); for(int i = 0; i < 50; i++) { System.out.println(name[i] +" ''+mk[i]); } } Class Rank extends Record { Public int index; Rank( ) { super.Record( ); index=0; } void highest() { index; int a = 0; for(int i = 0; i < 50; i++) { for(int j = 0; j < 50; j++) { if (mk [i] < mk [j]) { index = i; } } } } void display() { Super.display( ); System.out.println ("The Topmost rank activer is " + name [index] + " "+ mk [index]); . }
Question 12.
A 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.
The details of the class Stack is given below:
Class name: Stack
Data members/instance variables:
st[]: the array to hold the names
size: the maximum capacity of the string array
top: the index of the topmost element of the stack
ctr: to count the number of elements of the stack
Member functions:
Stack( ): default constructor
Stack(int cap): constructor to initialize size = cap and top = -1
void pushname(String n): to push a name onto the stack. If the stack is full, display the message “OVERFLOW”
String popname(): removes a name from the top of the stack and returns it. If the stack is empty, display the message “UNDERFLOW”
void display(): Display the elements of the stack.
(a) Specify class Stack giving details of the constructors(), void pushname(String n), String popname() and void display(). [8]
THE MAIN() FUNCTION AND ALGORITHM NEED NOT BE WRITTEN.
(b) Under what Principle does the above entity work?
Answer 12:
(a) Class Stack { String ST [ ]; int size; int top; int etr; Stack( ) { for(int i = 0; i <10; i++) St [i] = " "; size = 0; top = 0; ctr = 0; Stack(int cap) { size = cap St [size]; top = -1 ; void pushname (String n) { if (top = = (size - 1)) System.out.println (''overflow''); else { top ++; St [top] = n; } } String popname( ) { String v; if(top = = -1) System.out.println(''underflow "); else { v = St[top]; System.out.println("poped element is''+'' : " + v); top--; } } void display { if(top == -1) System.out.println(''empty''); else { for (int i = top-1; i > = 0 ; i--) { System.out.println(St [i]): } } }
(b) Stack works on LIFO (Lost In First Out) principle.
Question 13.
(a) A linked list is formed from the objects of the class, [4]
class Node { into info; Node link; }
Write an algorithm OR a Method for deleting a node from a linked list.
The method declaration is given below :
void delete node (Node start)
(b) Distinguish between worst-case and best-case complexity of an algorithm. [2]
(c) Answer the following from the diagram of a Binary Tree given below:
(i) Write the Postorder tree traversal. [1]
(ii) Name the Leaves of the tree. [1]
(iii) Height of the tree. [1]
(iv) Root of the tree. [1]
Answer 13:
(a) Algorithm
(i) Copy the content of the next mode into the mode that has to be deleted.
(ii) Assign the next pointer of the newly copied node of the next pointer of the node from the content has been copied.
(iii) Delete the node from the data has copied.
(b) Best case scenario for an algorithm is the arrangement of data for which the algorithm performs the best, eg., binary search.
The worst-case scenario, on the other hand, describes the absolute worst set of input for a given algorithm, e.g., quicksort.
(c)
(i) B D G H F E C A
(ii) B, D, G, H
(iii) 5
(iv) A
-: End of ISC Computer Science 2011 Class-12 Solved Paper :-
Return to – ISC Class-12 Solved Previous Year Question Paper
Thanks
Please Share with Your Friends
The post ISC Computer Science 2011 Class-12 Previous Year Question Papers Solved appeared first on ICSEHELP.
]]>ISC Computer Science 2012 Class-12 Previous Year Question Paper Solved for practice. Step by step Solutions with Questions of Part-1 and Part-2 (Section-A,B and C). By the practice of Computer Science 2012 Class-12 Solved Previous Year Question Paper you can get the idea of solving. Try Also other year except ISC Computer Science 2012 Class-12 Solved Question Paper of Previous […]
The post ISC Computer Science 2012 Class-12 Previous Year Question Papers Solved appeared first on ICSEHELP.
]]>ISC Computer Science 2012 Class-12 Previous Year Question Paper Solved for practice. Step by step Solutions with Questions of Part-1 and Part-2 (Section-A,B and C). By the practice of Computer Science 2012 Class-12 Solved Previous Year Question Paper you can get the idea of solving.
Try Also other year except ISC Computer Science 2012 Class-12 Solved Question Paper of Previous Year for more practice. Because only ISC Computer Science 2012 Class-12 is not enough for complete preparation of next council exam. Visit official website CISCE for detail information about ISC Class-12 Computer Science.
-: Select Your Topics :-
Maximum Marks: 70
Time allowed: 3 hours
Part – I (20 Marks)
Answer all questions.
While answering questions in this Part, indicate briefly your working and reasoning, wherever required.
Question 1.
(a) Using a truth table, verify the following expression: [2]
X + (Y + Z) = (X + Y) + Z
Also, state the law.
(b) Given, F (X, Y, Z) = (X’ + Y’) . (Y + Z’) [2]
Write the function in the canonical product of sum form.
(c) Draw the truth table and logic circuit for a 2-input XNOR gate. [2]
(d) Find the complement of the following expression: [2]
X’ + XY’
(e) If (X ⇒ Y) then write its: [2]
(i) Converse
(ii) Contra positive
Answer 1:
Question 2.
(a) Differentiate between the keywords extends and implements. [2]
(b) State how a binary tree is a recursive data structure. [2]
(c) A matrix B[10][7] is stored in the memory with each element requiring 2 bytes of storage. If the base address at B [x] [1] is 1012 and the address at B |7][3] is 1060, determine the value of ‘x’ where the matrix is stored in Column Major wise. [2]
(d) Convert the following infix notation to its postfix form: [2]
A + (B + C) + (D + E) * F)/G
(e) What is a constructor? State one difference between a constructor and any other member function of a class. [2]
Answer 2:
(a)
Extends | Implements |
1. Extends keyword is used to implement the concept of inheritance.
2. Extends is used when creating a sub-class. |
1. Implements keyword is used for implementing an interface by a class.
2. Implements are used when implementing an interface. |
(b) A tree is a recursive data structure because each node has a reference to its other subtrees. e.g. the following binary tree:
has two binary trees as its children, which are:
This property of the binary tree is applicable at all levels of binary trees.
(c) Given
i = 10, j = 7, w = 2, B = 1012
r = 10, w = ?
Add [i][j] = 1060
Colomn wise
Add [i][i] = B + [(J – Lc) + (I – Lr)]
⇒ 1060 = 1012 + [(3 – 1) * 10 + (7 – x)] * 2
⇒ 1060 – 1012 = 2 [(7 – x) + 20]
⇒ 48 = 2[(7 – x) + 20]
⇒ 7 – x = 4
⇒ x = 7 – 4 = 3
(d) A + (B + C) + (D + E)*F)/G
= A + (BC + + DE + * F)/G
= A + (BC + + DE + F*)/G
= A + BC + DE + F* + /G
= A + BC + DE + F* + G/
= ABC + DE + F* + G/+
(e) Constructor is a member function used to create and initialise the object with legal set of values. Constructors have same name as that of class while functions have different names.
Question 3.
(a) The following function is a part of some class which computes and sorts an array arr [] is ascending order using the bubble sort technique. There are some places in the code marked by ?1?, ?2?, ?3?, ?4?, ?5? which must be replaced by a statement/expression so that the function works properly:
void bubblesort (int arr []) { int i. j, k temp; for (i = 0; ?1?; i ++) { for (j = 0; ?2?;j++) { arr[j] > ?3?) { temp = arr [j]; ?4? = arr [j + 1]; arr [j + 1] = ?5?; } } } }
(i) What is the expression or statement at ?1? [1] (ii) What is the expression or statement at ?2? [1] (iii) What is the expression or statement at ?3? [1] (iv) What is the expression or statement at ?4? [1] (v) What is the expression or statement at ?5? [1] (b) The following function witty() is a part of some class. What will be the output of the function witty( ) when the value of n is ‘SCIENCE’ and the value of p is 5. Show the dry run/working: [5]
void witty (String n, int p) { if (p < 0) System.out.println(" "); else { System. out .printing. char At (p) + " . "); witty (n, p - 1); System.out.print[n. char At (p)]: } }
Answer 3:
(a)
(i) i < arr.length
(ii) j < arr.length – 1 – i
(iii) arr [j + 1]
(iv) arr [j]
(v) temp
(b) C.
N.
E.
I.
C.
S.
SCIENCE.
Part- II (50 Marks)
Answer six questions in this part, choosing two questions from Section A, two from Section B and two from Section C.
Section – A
Answer any two questions.
Question 4.
(a) Given the Boolean function:
F(A, B, C, D) = Σ (4, 6, 7, 10, 11, 12, 14, 15).
(i) Reduce the above expression by using 4-variable K-Map. showing the various groups (i.e., octal, quads and pairs). [4]
(ii) Draw the logic gate diagram of the reduced expression. Assume that the variables and their complements are available as inputs. [1]
(b) Given the Boolean function:
F (P, Q, R, S) = Π (0, 5, 7, 8, 10, 12, 13, 14, 15)
(i) Reduce the above expression by using 4-variable K-Map, showing the various groups (i.e., octal, quads and pairs). [4]
(ii) Draw the logic gate diagram of the reduced expression. Assume that the variables and their complements are available as inputs. [1]
Answer 4:
(a) F(A, B, C, D) = Σ (4, 6, 7, 10, 11, 12, 14, 15).
Question 5.
(a) The Principal of a school intends to select students for admission to class XI on the following criteria:
The student is of the same school and has passed the class X Board Examination with more than 60% marks.
Or
Students are of the same school, has passed the class X Board Examination with less than 60% marks but has taken an active part in co-curricular activities.
Or
The student is not from the same school but has either passed the class X Board Examination with more than 60% marks or has participated in sports at the National Level.
The inputs are:
Inputs | |
S | Student of the same school. |
P | Has passed the class X Board Examination with more than 60% marks. |
C | Has taken an active part in co-curricular activities. |
T | Has participated in sports at the National Level. |
(b) Output: X-Denotes admission status [1 indicates granted and 0 indicates refused in all the cases.]
(a) Draw the truth table for the inputs and outputs given above and write the SOP expression. [5]
(b) Reduce X (S, P, C, T) using Karnaugh’s Map.
Draw the logic gate diagram for the reduced SOP expression for X (S, P, C, T) 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]
Answer 5:
Question 6.
(a) Verify algebraically if, [3]
X’Y’Z’ + X’Y’Z + X’YZ + X’YZ’ + XY’Z’ + XY’Z = X’ + Y’
(b) Represent the Boolean expression X + YZ’ with the help of NOR gates only. [3]
(c) Define the terms Contingency, Contradiction and Tautology. [4]
(d) Consider the following truth table where A and B are two inputs and X is the output:
(i) Name and draw the logic gate for the given truth table.
(ii) Write the POS of X (A, B).
Answer 6:
(c) Contingency: The proposition that has some combination of 0’s and 1’s in their truth table column are called contingency.
Contradiction: The propositions having only O’S m their truth table column are called contradictions.
Tautology: The propositions having the only 1’s in their truth table column are called tautologies.
Question 7.
(a) Define Multiplexer and state one of its uses. Draw the logic diagram for a 4 : 1 Multiplexer. [4]
(b) State how a Half Adder is different from a Full Adder. Also, give their respective uses. [3]
(c) Minimize the following expression using Boolean laws: [3]
Q.(Q’ + P)R.(Q + R)
Also, draw the logic gate for the reduced expression.
Answer 7:
(a) A multiplexer is a combinational circuit that selects binary information from more than one input lines and directs it to a single output line.
It is used in parallel to serial conversion.
(b) Half Adder is used to add two bits while Full Adder is used to add three bits. Adders are used in ALU to process binary number.
Section – B
Answer any two questions.
Question 8.
A class Combine contains an array of integers which combines two arrays into a single array including the duplicate elements, if any, and sorts the combined array. Some of the members of the class are given below: [10]
Class name: Combine
Data Members/instance variables:
com[]: integer array
size: size of the array
Member functions/methods:
Combine(nt nn): parameterized constructor to assign size = nn
void inputarray(): accepts the array elements.
void sort(): sorts the elements of the combined array in ascending order using the selection sort technique.
void mix(Combine A, Combine B): combines the parameterized object arrays and stores the result in the current object array along with duplicate elements, if any.
void display(): displays the array elements
Specify the class Combine giving details of the constructor (int), void inputarray(), void sort(), void mix (Combine, Combine) and void display (). Also, define the main() function to create an object and call the methods accordingly to enable the task.
Answer 8:
Import java. io.*; class Combine { int com [], size; public Combine (int nn) { size = nn; com = new int [size]; } void inputarray () throws IOException { Buffered Reader br = new Buffered Reader [new Input Stream Reader (System.in)]; int i; for (i = 0; i < size; i++) { System.out.println ("Enter a no."); com [i] = Integer.parseInt[br.readLine ()]; } } void sort () { int i, j, t; for (i = 0; z < size; i++) { for (j = i + 1; j < size; j++) { if (com[i] > com [j]) { t = com [i]; com [i] = com [j]; com [j] = t; } } } } void mix (Combine A, Combine B) { int i, j; for (i = 0, j = 0; i < A.size; i ++, j++) { com[j] = A.com[i]; { for (i = 0; i < B.size; i++, j++) { com [j] = B.com [i]; } } void display () { int i; for (i = 0; i < size; i ++) { System.out.println(com[i]); } } public static void main (String args [ ]) throws IOException { Combine c1 = new Combine(5); Combine c2 = new Combine(3); Combine c3 = new Combine(8); c1.inputarray(); c2.inputarray(); c3.mix (c1, c2); c3.sort(); c3.display(); } }
Question 9.
Design a class VowelWord to accept a sentence and calculate the frequency of words that begin with a vowel. The words in the input string are separated by a single blank space and terminated by a full stop. The description of the class is given below: [10]
Class name: VowelWord
Data Members/instance variables:
str: to store a sentence
freq: store the frequency of the words beginning with a vowel.
Member functions:
VowelWord(): constructor to initialize data members to a legal initial value
void readstr(): to accept a sentence
void freq_vowel: counts the frequency of the words that begin with a vowel
void display(): to display the original string and the frequency of the words that begin with a vowel.
Specify the class VowelWord giving details of the constructor (), void readstr (), void freq_vowel () and void display (). Also, define the main () function to create an object and call the methods accordingly to enable the task.
Answer 9:
import java.io.*; class VowelWord { String str; int freq; public VowelWord() { str = "Evergreen Publications, Jalandhar, Punjab"; freq = 0; } void readstr( )throws IOException { BufferedReader br = new BufferedReader (new InputStreamReader (System.in)); System.out.println('Enter a Sentence.'); str = br.readLine (); } void freq vowel() { String w; int i , l; char ch; l = str.length(); for (i = 0; i< 1; i++) { w = " "; while(str.charAt (i) ! = '' && str.chartAt(i)! =' ') { w = w + str.charAt (i); i++; } w = w.toLowerCase(); ch = w.charAt(0); if (ch == 'a' || ch == 'e' || ch = 'i' || ch = 'o' || ch = 'u') { freq++; } } } void display() { System.out.println("Original String : " + str); System.out.println("Frequency of Words Beginning with vowel are : " + freq); } public static void main(String args[])throws IOException { VowelWord ob = new VowelWord(); ob.readstr(); ob.ffeq _vowel(); ob.display( ); } }
Question 10.
A happy number is a number in which the eventual sum of the square of the digits of the number is equal to 1. [10]
Example:
28 = (2)^{2} + (8)^{2} = 4 + 64 = 68
68 = (6)^{2} + (8)^{2} = 36 + 64 = 100
100 = (1)^{2} + (0)^{2} + (0)^{2} = 1 + 0 + 0 = 1
Hence, 28 is a happy number.
Example:
12 = (1)^{2} + (2)^{2} = 1 + 4 = 5
Hence, 12 is not a happy number.
Design a class Happy to check if a given number is a happy number. Some of the members of the class are given below:
Class name: Happy
Data Members/instance variables:
n: stores the number Member functions
Happy( ): constructor to assign 0 to n.
void getnum (int nn): to assign the parameter value to the number n = nn.
int sum_sq_digits (int x): returns the sum of the square of the digits of the number x, using the recursive technique
void is happy (): checks if the given number is a happy number by calling the function sum_sq_digits(int) and displays an appropriate message.
Specify the class Happy giving details of the constructor (), void getnum (int), int sum_sq_digits (int) and void ishappy (). Also define a main ( s) function to create an object and call the methods to check for happy number.
Answer 10:
class Happy { int n, s, d; public Happy() { n = 0; } void getnum (int nn) { n = nn, } int sum_sq_digits(int x) { if (x > 0) { d = x%10; s = s + d*d; x = x/10; return (sum_sq_digits (x)); } else { returns; } } void ishappy () { int a; while (n > 9) { s = 0; n = sum_sq_digits(n): } if (n== 1) System.out.println("Happy No."); else System out.println("Not a Happy No."); } }
Section – C
Answer any two questions.
Question 11.
Link is an entity which can hold a maximum of 100 integers. Link enables the user to add elements from the rear end and remove integers from the front end of the entity. Define a class Link with the following details:
Class name: Link
Data Members/instance variables:
Ink []: entity to hold the integer elements,
max: stores the maximum capacity of the entity,
begin: to point to the index of the front end.
end: to point to the index of the rear end.
Member functions:
Link(intmm): constructor to initialize max = mm. begin = 0. end = 0.
void addlink (int v): to add an element from the rear index if possible otherwise display the message “OUT OF SIZE… ”
int dellink(): to remove and return an element from the front index. if possible otherwise display the message “EMPTY …” and return – 99.
void display(): displays the elements of the entity.
(a) Specify the class Link giving details of the constructor (int), void addlink (int), int dellink() and void display ( ). [9]
THE MAIN FUNCTION AND ALGORITHM NEED NOT BE WRITTEN.
(b) What type of data structure is the above entity? [1]
Answer 11:
(a) class Link { int Ink [ ] = new int [100]; int begin, end. max; public Link (int mm) { max = mm; begin = end = 0; } void addlink(int v) { if (end==0) { end = begin = 1; Ink [end] = v; } else if (end == max) { System.out.println("List is Full"); } else Ink [++end] = v; } } int dellink () { int a; if (begin == 0) { System.out.println(" Empty..."); return - 99; } else if (begin == end) { a = Ink [begin]; begin = end = 0; return a; } else { a = Ink [begin]; begin++; return (a); } } void display() { int i; for(i = begin; i < = end; i++) { System.out.println(lnk[i]); } } }
(b) It is a Queue.
Question 12.
A superclass Detail has been defined to store the details of a customer. Define a subclass Bill to compute the monthly telephone charge of the customer as per the chart is given below:
Number of calls: Rate
1 – 100: Only rental charge
101 – 200: 60 paise per call + rental charge
201 – 300: 80 paise per call + rental charge
Above 300: 1 rupee per call + rental charge
The details of both the classes are given below:
Class name: Detail
Data members/instance variables:
name: to store the name of the customer
address: to store the address of the customer
telno: to store the phone number of the customer
rent: to store the monthly rental charge
Member functions:
Detail (…): parameterized constructor to assign values to data members
void show (): to display the details of the customer
Class name: Bill
Data members/instance variables:
n: to store the number of calls
amt: to store the amount to be paid by the customer
Member functions:
Bill (…): parameterized constructor to assign values to data members of both classes and to initialize amt = 0.0
void cal(): calculate the monthly telephone charge as per the chart is given above
void show(): displays the details of the customer and amount to be paid.
Specify the class Detail giving details of the constructor, and void show(). Using the concept of inheritance, specify the class Bill giving details of the constructor(), void cal() and void show().
THE MAIN ( ) FUNCTION AND ALGORITHM NEED NOT BE WRITTEN.
Answer 12:
class Detail { protected String name, add; protected long telno; protected double rent; public Detail (String n, String a, long t, double r) { name = n; add = a; telno = t; rent = r; } void show () { System.out.println(name + " " + add + " " + telno + " " + rent); } } class Bill extends Detail { int n; double amt; public Bill (String nm, string ad, long tn, double rn, int, n1) { super (nm, ad, tn, rn): n = n1; amt = 0.0; } void cal () { if (n > = 1 && n < = 100) { amt = rent; } else if (n > 100 && n < = 200) { amt = rent + (n - 100) * 0.60; } else if (n > 200 && n< = 300) { amt = rent + 100 * 0.60 + (n - 200) * 0.80: } else if (n > 300) { amt = rent + (0.60 * 100) + (0.80 * 100) + (n - 300) * 100); } void show() { super.show(); System.out.println("Amount to be paid = "+amt/100 + "Rs"); } }
-: End of ISC Computer Science 2012 Class-12 Solved Paper :-
Return to – ISC Class-12 Solved Previous Year Question Paper
Thanks
Please Share with Your Friends
The post ISC Computer Science 2012 Class-12 Previous Year Question Papers Solved appeared first on ICSEHELP.
]]>ISC Computer Science 2013 Class-12 Previous Year Question Paper Solved for practice. Step by step Solutions with Questions of Part-1 and Part-2 (Section-A,B and C). By the practice of Computer Science 2013 Class-12 Solved Previous Year Question Paper you can get the idea of solving. Try Also other year except ISC Computer Science 2013 Class-12 Solved Question Paper of Previous […]
The post ISC Computer Science 2013 Class-12 Previous Year Question Papers Solved appeared first on ICSEHELP.
]]>ISC Computer Science 2013 Class-12 Previous Year Question Paper Solved for practice. Step by step Solutions with Questions of Part-1 and Part-2 (Section-A,B and C). By the practice of Computer Science 2013 Class-12 Solved Previous Year Question Paper you can get the idea of solving.
Try Also other year except ISC Computer Science 2013 Class-12 Solved Question Paper of Previous Year for more practice. Because only ISC Computer Science 2013 Class-12 is not enough for complete preparation of next council exam. Visit official website CISCE for detail information about ISC Class-12 Computer Science.
-: Select Your Topics :-
Maximum Marks: 70
Time allowed: 3 hours
Part – I (20 Marks)
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 = P.R + Q’.R
(b) Minimize the expression using Boolean laws: [2]
F = (A + B’)(B + CD)’
(c) Convert the following cardinal form of expression into its canonical form: [2]
F (P, Q, R) = π (1, 3)
(d) Using a truth table verify: [2]
(~p => q) ∧ p = (p ∧ ~q) ∨ (p ∧ q)
(e) If A = 1 and B = 0, then find: [2]
(i) (A’ + 1).B
(ii) (A + B7
Answer 1:
(a) To every Boolean equation there exists another equation which is dual to the previous equation. This is done by changing AND’s to OR’s and vice-versa, 0’s to Fs and vice-versa, complements remain unchanged.
Dual: (P.Q’) + R + 0 = (P + R). (Q’+ R)
(b) F = (A + B’).(B + CD)’
F = (A + B’). (B’. (CD)’)
F = AB’+B’B’.(C’+D’)
F = B’.(C’+D’)
(c) F(P, Q, R) = π(1, 3)
= 001, 011
= (P + Q + R’).(P + Q’ + R’)
(d) (~p => q) ∧ p = (p ∧ ~q) ∨ (p ∧ q)
(e)
(i) (A’ + 1).B = (0 + 1). 0 = 0
(ii) (A+B’)’ = (1 + 1)’ = (1)’ = 0
Question 2.
(a) Differentiate between throw and throws with respect to exception handling. [2]
(b) Convert the following infix notation to its postfix form: [2]
E*(F/(G-H)*I) + J
(c) Write the algorithm for push operation (to add elements) in an array based stack. [2]
(d) Name the File Stream classes to: [2]
(i) Write data to a file in binary form.
(ii) Read data from a file in text form.
(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]
Answer 2:
(a) Throw: This clause is used to explicitly raise a exception within the program, the statement would throw new exception.
Throws: This clause is used to indicate the exception that are not handled by the method.
(b) E * (F/(G-H) * I) +J
= E*(F/GH- *I) + J
= E * FGH-/I * + J
= EFGH-/I**J +
(c) Step 1: Start
Step 2: if top >= capacity then OVERFLOW, Exit
Step 3: top = top+1
Step 4: Stack [top] = value
Step 5: Stop
(d)
(i) FileOutputStream/DataOutputStream/FileWriter/OutputStream
(ii) FileReader / DatalnputStream/ InputStream/ FilelnputStream
(e) Row Major address formula:
M[i] [j] = BA+W [(i – Ir) * column + (j – Ic)]
BA: 1840, Ir = 0, Ic = 0, W = 4, rows = 10, column = 10, i = 4, j = 8
M[4] [8] = 1840 + 4 [(4 – 0) × 10+ (8 – 0)]
= 1840 + 192
= 2032
Question 3.
(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]
void Recur (int n) { if (n>1) { System.out.print (n + " " ); if(n%2 !=0) { n = 3* n + 1; System.out.print(n + " "); } Recur (n/2); } }
(b) The following function is a part of some class. Assume ‘n’ is a positive integer. Answer the given questions along with dry run / working,
int unknown (int n) { int i, k; if (n%2 = = 0) { i = n/2; k=1; } else { k=n; n--; i=n/2; } while (i > 0) { k=k*i*n; i--; n--; } return k; }
(i) What will be returned by unknown(5)? [2]
(ii) What will be returned by unknown(6)? [2]
(iii) What is being computed by unknown (int n)? [1]
Answer 3:
(a) Recur (10)
10 Recur (5)
5
16 Recur (8)
8 Recur (4)
4 Recur (2)
2 Recur (1)
OUTPUT: 10 5 16 8 4 2
(b) (i) 120
(ii) 720
(iii) calculate factorial/ product
Part- II (50 Marks)
Answer six questions in this part, choosing two questions from Section A, two from Section B and two from Section C.
Section – A
Answer any two questions.
Question 4.
(a) Given the Boolean function: F(A, B, C, D) = Σ (0, 2, 4, 5, 8, 9, 10, 12, 13)
(i) Reduce the above expression by using 4-variable K-Map, showing the various groups (i.e. octal, quads and pairs). [4]
(ii) Draw the logic gate diagram of the reduced expression. Assume that the variables and their complements are available as inputs. [ 1]
(b) Given the Boolean function : F(P, Q, R, S) = Π (0, 1, 3, 5, 7, 8, 9, 10, 11, 14, 15)
(i) Reduce the above expression by using 4-variable K-Map, showing the various groups (i.e. octal, quads and pairs). [4]
(ii) Draw the logic gate diagram of the reduced expression. Assume that the variables and their complements are available as inputs. [1]
Answer 4:
(a) F(A, B, C, D) = Σ (0, 2, 4, 5, 8, 9, 10, 12, 13)
Question 5.
A Football Association coach analyzes the criteria for a win/draw of his team depending on the following conditions:
If the Centre and Forward players perform well but Defenders do not perform well.
or
If Goalkeeper and Defenders perform well but the Centre players do not perform well.
or
If all the players perform well.
The inputs are:
Inputs | |
C | Centre players perform well. |
D | Defenders perform well. |
F | Forward players perform well. |
G | Goalkeeper performs well. |
(In all of the above cases 1 indicates yes and 0 indicates no)
Output: X – Denotes the win/draw criteria [1 indicates win/draw and 0 indicates defeat in all cases.]
(a) Draw the truth table for the inputs and outputs given above and write the POS expression for X(C, D, F, G). [5]
(b) Reduce X(C, D, F, G) using Karnaugh’s Map.
Draw 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]
Answer 5:
Question 6.
(a) In the following truth table, x and y are inputs and B and D are outputs: [3]
Answer the following questions:
(i) Write the SOP expression for D.
(ii) Write the POS expression for B.
(iii) Draw a logic diagram for the SOP expression derived for D, using only NAND gates.
(b) Using a truth table, verify if the following proposition is valid or invalid:
(a =>b) ∧ (b =>c) = (a =>c) [3]
(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]
Answer 6:
Question 7.
(a) What are Decoders? How are they different from Encoders? [2]
(b) Draw the truth table and a logic gate diagram for a 2 to 4 Decoder and briefly explain its working. [4]
(c) A combinational logic circuit with three inputs P, Q, R produces output 1 if and only if an odd number of 0’s are inputs. [4]
(i) Draw its truth table.
(ii) Derive a canonical SOP expression for the above truth table.
(iii) Find the complement of the above-derived expression using De Morgan’s theorem and verify if it is equivalent to its POS expression.
Answer 7:
(a) Decoders are a combinational circuit which inputs ‘n’ 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.
Working: 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.
(ii) X (P, Q, R) = P’Q’R’ + P’QR + PQ’R + PQR’
(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.
Section – B
Answer any two questions.
Question 8.
An 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]
Design a class Emirp to check if a given number is Emirp number or not. Some of the members of the class are given below:
Class name: Emirp
Data members/instance variables:
n: stores the number
rev: stores the reverse of the number
f: stores the divisor
Member functions:
Emirp(int nn): to assign n = nn, rev = 0 and f = 2
int isprime(int x): check if the number is prime using the recursive technique and return 1 if prime otherwise return 0
void 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
Specify 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.
Answer 8:
import java.util. Scanner; public class Emirp { int n,rev,f; Emirpfint nn) { n=nn; rev=0; f=2; } intisprime(int x) { if(n==x) { return 1; } else if (n%x = = 0 ||n == 1) { return 0; } else return isprime(x+1); } void isEmirp() { int x=n; while(x!=0) { rev=(rev* 10) + x%10; x=x/10; } int ans1=isprime(f); n=rev; f=2; int ans2=isprime(f); if(ans 1 ==1 && ans2==1) System. out.println(n+" is anEmirp number"); else System.out.println(n+" is not an Emirp number"); } public static void main() { Scanner sc=new Scanner(System.in); System.out.println("\n Enter a number"); int x=sc.nextInt(); Emirp obj = new Emirp(x); obj.isEmirp(); } }
Question 9.
Design 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]
Example:
Input: It is a warm day.
Output: tI si a mraw yad
Some of the data members and member functions are given below:
Class name: Exchange
Data members/instance variables:
sent: stores the sentence
rev: to store the new sentence
size: stores the length of the sentence
Member functions:
Exchange(): default constructor
void readsentence(): to accept the sentence
void exfirstlast(): extract each word and interchange the first and last alphabet of the word and form a new sentence rev using the changed words
void display(): display the original sentence along with the new changed sentence.
Specify 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.
Answer 9:
importjava.util.*; public class Exchange { String sent,rev; int size; Exchange() { sent=null; rev=""; } void readsentence() { Scanner sc=new Scanner(System.in); System.out.print("\n Enter a sentence "); sent=sc.nextLine(); size=sent.length(); } void exfirstlast() { int p=0; char ch; String b; for(inti=0;i<size;i++) { ch=sent.charAt(i); if(ch=="||ch =='.’) { b=sent. substring(p,i); if(b.length() != 1) { rev += b.qharAt(b.length()-1); rev = rev + b.substring(l,b.length()-1); rev += b.charAt(0); } else rev = rev + b; rev = rev +" "; p=i+1; } } } void display() { System.out.print("\n Input: " + sent); System.out.print("\n Output:" + rev); } public static void main() { Exchange obj = new Exchange(); obj.readsentence(); obj.exfirstlast(); obj. display(); } }
Question 10.
A class Matrix contains a two-dimensional integer array of an order [m * n]. The maximum value possible for both ‘m’ and ‘n’ 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]
Class name: Matrix
Data members/instance variables:
arr[][]: stores the matrix element
m: integer to store the number of rows
n: integer to store the number of columns
Member functions:
Matrix (int mm, int nn): to initialize the size of the matrix m = mm and n = nn
void fillarray(): to enter the elements of the matrix
Matrix SubMat(Matrix A): subtract the current object from the matrix of the parameterized object and return the resulting object
void display(): display the matrix elements
Specify 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.
Answer 10:
import java.util. Scanner; public class Matrix { static Scanner sc=new Scanner(System.in); int arr[] []=new int[25] [25]; int m,n; Matrix(int mm, int nn) { m=mm; n=nn; } voidfillarray() { System.out.print("\n Enter elements of array"); for(int i=0;i<m;i++) { for(int j=0;j<n; j++) arr[i] [j]=sc.nextInt(); } } Matrix SubMat(Matrix A) { Matrix B=new Matrix(m,n); for(int i=0;i<m;i++) { for(int j=0;j<n; j++) Barr[i][j]= arr[i][j] - A.arr[i][j]; } return B; } void display() { for(int i=0;i<m;i++) { System.out.println(); { for(int j=0;j<n;j++) System, out.print(arr[i][j] +" \t"); } } } public static void main() { System.out.print("\n Size of array"); int x=sc.nextInt(); int y=sc.nextInt(); Matrix A=new Matrix(x, y); Matrix B=new Matrix(x, y); Matrix C=new Matrix(x, y); A.fillarray(); B.fillarray(); C=A.SubMat(B); C.display(); } }
Section – C
Answer any two questions.
Question 11.
A 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]
Class name: Perimeter
Data members/instance variables:
a: to store the length in decimal
b: to store the breadth in decimal
Member functions:
Perimeter (…): parameterized constructor to assign values to data members
double Calculate(): calculate and return the perimeter of a parallelogram is 2* (length + breadth)
void show(): to display the data members along with the perimeter of the parallelogram
Class name: Area
Data members/instance variables:
h: to store the height in decimal
area: to store the area of the parallelogram
Member functions:
Area(…): parameterized constructor to assign values to data members of both the classes
void doarea(): compute the area as (breadth * height)
void show(): display the data members of both classes along with the area and perimeter of the parallelogram.
Specify 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.
Answer 11:
import java.util.*; class Perimeter { protected double a,b; Perimeter(double aa, double bb) { a=aa; b=bb; } double Calculate() { return (2*(a+b)); } void show() { System.out.print("\n Length = " + a); System.out.print("\n Breadth = " + b); System.out.print("\n Perimeter =" + Calculate()); } } importjava.util.*; class Area extends Perimeter { double h; double area; Area(double aa, double bb, double cc) { super(aa, bb); h=cc; } void doarea() { area=super.b*h; } void show() { super, show(); System, out.print("\n Height = " + h); System.out.print("\n Area = " + area); } }
Question 12.
A 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]
Class name: Dequeue
Data members/instance variables:
arr[ ]: array to hold up to 100 integer elements
lim: stores the limit of the dequeue
front: to point to the index of the front end
rear: to point to the index of the rear end
Member functions:
Dequeue(int 1): constructor to initialize the data members lim = 1; front = rear = 0
void 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”)
int popfront(): returns element from front, if possible otherwise returns – 9999
int poprear(): returns element from rear, if possible otherwise returns – 9999
Specify 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.
Answer 12:
public class Dequeue { int arr[] = new int[100]; int lim,front,rear; Dequeue(int 1) { lim=1; front=0; rear=0; arr=newint[lim]; } void addfront(int val) { if(front>0) arr[front--]=val; else System.out.print("\n Overflow from front"); } void addrear(int val) { if(rear<lim-1) arr[++rear]=val; else System.out.print("\n Overflow from rear"); } int popfront() { if(front!=rear) return arr[++front]; else return -9999; } int poprear() { if(front!=rear) return arr[rear--]; else return -9999; } }
Question 13.
(a) A linked list is formed from the objects of the class: [4]
class Node { int item; Node next; }
Write an Algorithm OR a Method to count the number of nodes in the linked list. The method declaration is given below:
int count (Node ptr-start)
(b) What is the Worst Case complexity of the following code segment: [2]
(i) for(int p = 0;p<N;p++) { for (int q=0; q < M; q++) { Sequence of statements; } } for(int r=0;r<X;r++) { Sequence of statements; }
(ii) How would the complexity change if all the loops went up to the same limit N?
(c) Answer the following from the diagram of a Binary Tree is given below:
(i) Preorder Transversal of the tree. [1]
(ii) Children of node E. [1]
(iii) The left subtree of node D. [1]
(iv) Height of the tree when the root of the tree is at level 0. [1]
Answer 13:
(a) Algorithm to count the number of nodes in a linked list
Steps:
1. Start
2. Set a temporary pointer to the first node and counter to 0.
3. Repeat steps 4 and 5 until the pointer reaches null
4. Increment the counter
5. move the temporary pointer to the next node
6. Return the counter value
7. End
Method to count for the number of nodes in a linked list
int count (Node ptr_start) { Node a = new Node(ptr_start); int c=0; while (a!=null) { c++; a=a.next; } return c: }
(b)
(i) O(N × M) + O(X) OR O(NM + X)
(ii) O( N2) OR O( N2 + N) = O(N2) (by taking the dominant term)
(c) (i) A, I, B, C, D, E, G, H, F
(ii) G and H
(iii) EGH
(iv) 4
-: End of ISC Computer Science 2013 Class-12 Solved Paper :-
Return to – ISC Class-12 Solved Previous Year Question Paper
Thanks
Please Share with Your Friends
The post ISC Computer Science 2013 Class-12 Previous Year Question Papers Solved appeared first on ICSEHELP.
]]>