# COMPUTER SCIENCE ISC CLASS XII BOARD 2013 SAMPLE PAPER

Mar 11 • Board Sample Papers • 4181 Views • 2 Comments on COMPUTER SCIENCE ISC CLASS XII BOARD 2013 SAMPLE PAPER

COMPUTER SCIENCE

ISC CLASS XII

Full Marks:100                                                                                              Total Time: 3 hrs

PART 1

• Answer all questions in this part
• While answering questions in this part, indicate briefly your working and reasoning wherever required.
1. (a) State the two DISTRIBUTIVE LAWS. Verify any one of them using truth table.               2

(b) Convert ( ( X’ Y ) + ( X’ Z’ ) )’ into canonical sum of products form.                                       2

(c) Reduce F(a,b,c,d) =∑(0,2,7,8,10,15) using Karnaugh map.                                                        2

(d) Represent ( A’ + B’ + C’ )( A + B’ + C’ )( A + B + C’ ) in NOR-to-NOR logic network.             2

(e) State and verify Principle of Duality.                                                                                  2

2.    (a) State the difference between class and interface.                                                 2

(b) Convert the following from infix to postfix notation.                                              2

(A-B)*(C/D)+E

(c) A 2D array defined as A[4…7,-1…3] requires 2 words of storage space for each element. If the array is stored in row major form, calculate the address of A[6,2], given the base address as 100.                                                                                                                                                                                                                                                                                          2

(d) Explain different notations of complexity.                                                                           2

(e) What is an abstract class? Explain with an example.                                                         2

3.      (a) The following public function is a part of some class. Assume n is always positive. Answer the questions. Give the 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 value will be returned by the expression unknown(7) ?                                2

(ii)                What value will be returned by the expression unknown(6) ?                                 2

(iii)               In one line say what is being computed by the function unknown(int n) ?                1

(b) The following function is a part of some class. What will be the output of the function mymethod() when the value of 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);

}

}

PART 2

Answer seven questions in this part, choosing three questions from Section A, two from Section B and two from Section C

SECTION A

4.    (a) Using Karnaugh map, simplify the following expressions, using sum-of-products form:

(i) A’ B’ C’ + A B’ C’ + A B C + A’ B’ C                                                   2

(ii) ABCD + A’ B’ C’ D + A’ BCD + A’ B’ CD + ABCD’                              2

(b) A truth table has output is for these inputs:

ABCD = 0011, ABCD = 0110, ABCD = 1001 and ABCD = 1110. Draw the Karnaugh map showing the fundamental products.                                                                                                     2

(c) Simplify and then draw the logic circuit for this Boolean equation:                        4

Y = A’ B’ C’ D + AB’ C’ D + ABC’ D + ABCD’

5.     (a) Obtain a simplified form for the following Boolean Expression using Karnaugh map and then draw the logic circuit for it.:                                                                                      5

F(a,b,c,d) = ∑(0,1,2,4,5,7,8,9,10,11,14)

(b) Obtain a simplified form for the following Boolean Expression using Karnaugh map and then draw the logic circuit for it using NOR gate only:                                                        5

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)

6. A government institution intends to award a medal to a person who qualifies any one of the following criteria:

• The person should have been an Indian citizen and had lost his/her life in a war but had not completed 25 years of service.

OR

• The person must be an Indian citizen and had served the nation for a continuous period of 25 years or more and has not lost his/her life in a war.

OR

• The person is not an Indian citizen but has taken active part in activities for the upliftment of the nation.

The inputs are:

INPUTS

A   The person is/was an Indian citizen

B   Has 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

OUTPUTS

X – Denotes eligible for medal

[ 1 indicates YES and 0 indicates NO in all cases]

(a)    Draw the truth table for the inputs and the outputs given above and write the POS expression for X(a,b,c,d).                                                                                                      5

(b)   Reduce X(a,b,c,d) using Karnaugh map.

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 variables and compliments are available as inputs.      5      7.    (a) How does Half adder differ from Full adder? Draw the truth table for both the adders. Also derive the expression for full adder and simplify it.                                                                   5

(b) From the given logic circuit draw the truth table and derive the Boolean expression.       3 (c)    Verify the following:                                                                                               2

∑(0,2,7,6) = π(1,3,4,5)

SECTION B

Each program should be written in such a way that it clearly depicts the logic of the program.

This can be achieved by using mnemonic names and comments in the program.

( Flowcharts and Algorithms are not required)

The program must be written in Java

8. The trigonometric function sec(x) can be computed as                                                 10

sec(x) = 1/cos(x)              x is in radians and (0<=x<=π/2)

The trigonometric function cos(x) can be computed by the following infinite series

cos(x) = 1 – x^2/2! + x^4/4! –x^6/6! ….                                 x is in radians and (0<=x<= π/2)

A class called MyMath has been defined to calculate the trigonometric functions. Some of the functions/methods in MyMath are shown below:

Class name         :MyMath

Data members/instance variables : x angle in a radian

Member functions/methods:

MyMath(double nx)       :constructor to assign x=nx

double abs(double y)     :calculates and returns absolute value of y

y=y when y>=0

y=-y when y<0

double cos()                       : calculates and returns value of cos() correct to 7 places                            after the decimal using infinite series given above when x is within the range otherwise it returns an error value 99999999.9

double sec()                       : calculates and returns value of sec() by using the value of cos()

(remember when x is in radian and 0<=x<= π/2 then 1>=cos()>=0)

Specify the class MyMath giving details of the constructor MyMath(double nx), double abs(double y), double cos(), double sec() only. You do not need to write the main() function.

9. A class called Number has been defined to find the frequency of each digit present in it and the sum of the digits and to display the results. Some of the members of the class Number are given below:                                                                                                                       10

Class Name         : Number

Data members  : num – long integer type

Member functions/methods      :

Number()            :constructor to assign 0 to num

Number(int n)   : constructor to assign n to num

void digitFrequency()     :to find the frequency of each digit and display it

int sumDigit()     : to find the sum of the digits of the number

Specify the class Number giving the details of the two constructors and functions void digitFrequency() and int sumDigit(). You do not need to write the main() function.

10. Design a class StringFun to perform various operations on strings without using built-in functions except for finding the length of the string. Some of the member functions/methods of the class are given below:                                                                                                         10

Class Name         :StringFun

Data members  :str[] to store a string

Member functions          :

void input()        : to accept the string

void words()      : to find and display number of words, number of vowels and number of uppercase characters in the string.

void frequency()              : to find the frequency of each characters in the string

Specify the class StringFun giving the details of the functions void input(), void words() and int frequency(). You do not need to write the main() function.

SECTION C

Each program/algorithm should be written in such a way that it clearly depicts the logic of the program step wise.

This can be achieved by using pseudo codes.

( Flowcharts are not required)

The program must be written in Java

The algorithm must be written in general/standard form.

11.       (a) A linked list is formed from the objects of the class,                                             4

Class node

{              int info;

}

Write an algorithm/method for deleting a node from any position of a linked list.

The method declaration is given below

void deletenode(node start)

(b) Distinguish between worst case and best case of an algorithm.                           2

(c) Answer the following questions from the binary tree given below: (i) Write the post order traversal of the tree.                                            1

(ii) Name the leaves of the tree.                                                             1

(iii) Height of the tree.                                                                           1

(iv) Root of the tree.                                                                              1

12. A class called Number contains the following data members and member functions to check for triangular numbers. [A triangular number is formed by the addition of a consecutive sequence of integers starting from 1]                                                                                    10

For ex. 1+2=3

1+2+3=6

1+2+3+4=10

1+2+3+4+5=15

Therefore 3, 6, 10, 15, etc. are triangular numbers.

Class Name         : Number

Data members/ instance variables           : n is an integer to be checked for whether it is triangular or not.

Member functions/methods      :

void getnum()   : to accept an integer

int check(int)     : to check whether n is triangular

void dispnum() : to display whether the number is triangular or not

Specify the class Number giving the details of the functions void getnum(), int check(int) and void dispnum(). You do not need to write the main() function.

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

(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 function accordingly to enable the above change in the given word.                                                                                                                          8

(b)   Differentiate between an infinite and a finite recursion.                                                       2