# ISC Computer Science 2012 Class-12 Previous Year Question Papers Solved

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.

## ISC Computer Science 2012 Class-12 Previous Year Question Paper Solved

Part-I

Section-A of Part-II

Section-B of Part-II

Section-C of Part-II

Maximum Marks: 70
Time allowed: 3 hours

• Candidates are allowed additional 15 minutes for only reading the paper. They must NOT start writing during this time.
• Answer all questions in Part-I (compulsory) and six questions from Part-II, choosing two questions from Section-A, two from Section-B and two from Section-C.
• All working, including rough work, should be done on the same sheet as the rest of the answer.
• The intended marks for questions or parts of questions are given in brackets [ ].

Part – I (20 Marks)

### ISC Computer Science 2012 Class-12 Previous Year Question Paper Solved

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: 
X + (Y + Z) = (X + Y) + Z
Also, state the law.
(b) Given, F (X, Y, Z) = (X’ + Y’) . (Y + Z’) 
Write the function in the canonical product of sum form.
(c) Draw the truth table and logic circuit for a 2-input XNOR gate. 
(d) Find the complement of the following expression: 
X’ + XY’
(e) If (X ⇒ Y) then write its: 
(i) Converse
(ii) Contra positive

Question 2.
(a) Differentiate between the keywords extends and implements. 
(b) State how a binary tree is a recursive data structure. 
(c) A matrix B is stored in the memory with each element requiring 2 bytes of storage. If the base address at B [x]  is 1012 and the address at B |7] is 1060, determine the value of ‘x’ where the matrix is stored in Column Major wise. 
(d) Convert the following infix notation to its postfix form: 
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. 
(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 = ?
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? 
(ii) What is the expression or statement at ?2? 
(iii) What is the expression or statement at ?3? 
(iv) What is the expression or statement at ?4? 
(v) What is the expression or statement at ?5? 
(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: 

```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)]:
}
}```

(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

### Previous Year Question Paper Solved ISC Computer Science 2012 Class-12

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). 
(ii) Draw the logic gate diagram of the reduced expression. Assume that the variables and their complements are available as inputs. 
(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). 
(ii) Draw the logic gate diagram of the reduced expression. Assume that the variables and their complements are available as inputs. 
(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. 
(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. 

Question 6.
(a) Verify algebraically if, 
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. 
(c) Define the terms Contingency, Contradiction and Tautology. 
(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).

(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. 
(b) State how a Half Adder is different from a Full Adder. Also, give their respective uses. 
(c) Minimize the following expression using Boolean laws: 
Q.(Q’ + P)R.(Q + R)
Also, draw the logic gate for the reduced expression.
(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.

Section – B

### ISC Computer Science 2012 Class-12 Previous Year Question Paper Solved

• Each program should be written in such a way that it clearly depicts the logic of the problem.
• This can be achieved by using mnemonic names and comments in the program.
• Flowcharts and Algorithms are not required
• The programs must be written in Java

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: 
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.

```Import java. io.*;
class Combine
{
int com [], size;
public Combine (int nn)
{
size = nn;
com = new int [size];
}
void inputarray () throws IOException
{
int i;
for (i = 0; i < size; i++)
{
System.out.println ("Enter a no.");
}
}
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: 
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.

```import java.io.*;
class VowelWord
{
String str;
int freq;
public VowelWord()
{
str = "Evergreen Publications, Jalandhar, Punjab";
freq = 0;
}
{
System.out.println('Enter a Sentence.');
}
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.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. 
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.

```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

### ISC Computer Science 2012 Class-12 Previous Year Question Paper Solved

• Each Program Algorithm should be written in such a way that it clearly depicts the logic of the problem stepwise.
• This can also be achieved by using pseudo-codes.
• Flowcharts are not required
• The programs must be written in Java.
• The algorithm must be written in general/standard form, wherever required.

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:
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.
THE MAIN FUNCTION AND ALGORITHM NEED NOT BE WRITTEN.
(b) What type of data structure is the above entity? 

```(a) class Link
{
int Ink [ ] = new int ;
int begin, end. max;
{
max = mm;
begin = end = 0;
}
{
if (end==0)
{
end = begin = 1;
Ink [end] = v;
}
else if (end == max)
{
System.out.println("List is Full");
}
else
Ink [++end] = v;
}
}
{
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
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.

```class Detail
{
protected long telno;
protected double rent;
public Detail (String n, String a, long t, double r)
{
name = n;
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)
{
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 :-

Thanks