0% found this document useful (0 votes)
254 views

ISC 2012 Computer Science Paper 1 Theory

ISC 2012 COMPUTER SCIENCE CLASS 12TH PAPER 1 THEORY

Uploaded by

Anonymous xGn6wM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
254 views

ISC 2012 Computer Science Paper 1 Theory

ISC 2012 COMPUTER SCIENCE CLASS 12TH PAPER 1 THEORY

Uploaded by

Anonymous xGn6wM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

COMPUTER SCIENCE

Paper-1
(THEORY)
Three /tOllrs
(Candidates are allowed additional 15 minutes/or only reading the paper.
They must NOT start writing during this time.)

Answer all questions in Part 1 (compulsory) and seven questions from Part 11, choosing three
questions from Section-A, two questionsfrom Section-B and two questions ji'om Section-C.
All working, including rough work, should be done on the same sheer as the rest oIthe anSHler.
The intended marks for questions or parts of questions are given in brackels [ ].

PART I
Answer all questions.
While answering questions in this Part, indicate briefly your working and reasoning.
wherever required.

Question t
(a) Using a truth table. verify the following expression: 121
X + (Y+Z)=(X + Y) + Z

Also state the law.

(b) Give n, F (X, Y, Z) = (X' + y') . ( y + Z') [2 J

write the function in canonical product-of-sum form .

(c) Draw the truth table and logic circuit for a 2-input XNOR gate. [21
(d) Find the complement of the following expression: 12J
X' + XY'

(e) If ( X ~ Y ) then write its : [2]

(i) Converse

(ii) Contra positive

This Paper consists of 10 printed pages.


1212-868 A Turn over
© Copyright reserved.

© www.javaforschool.com
Question 2
(a) Oi rrerentiate between the keywords ex/ends and implements. [2 J
(b) State how a binary tree is a recursive data structure . (2]
(e) A matri x B[ I 0][7] is stored in the memory with each element requiring 2 bytes of 121
storage . If the base address at B [x] [1] is 10] 2 and the address at B [7][3 J is 1060,
determine the value 'x' where the matrix is stored in Column Major wise.
(d) Convert the following infix notation to its postfix form: 121
!\ + ( (B+C) + (O+E) *F)/G
(e) What is. a constructor? State one di fference between a constructor and an y other 121
member function of a class.

Question 3

(a) The following function is a part of some class \,vhich computes and sorts an array
arr[ ] in ascending order using the bubble sort technique . There are so me pbces
in the code marked by ?l '!, ?2?, ?3?, ?4?, ?S? which must be replaced by a
statement / expression so that the function works properly :
void bubblesort( i nt arr[ ])

int i, .j, k, tmp:


for(i = 0: ?l? ; i++)
{
for(j = 0; ?2?; j++)
{
if(aJT[j] > ?3?)
{
tmp arr[j] :
?4? arr[j + 1L
arrU + l] = ?5?:
}

(i) What is the express ion or statement at ?1 ? III


(i i) What is the express ion or statement at '?2? [1]

(i ii) What is the expression or statement at ?3? ttl


(i v) What is the expression or statement at ?4? 111
(v) What is the expression or statement at ?S? (11

2
1212-868A
© www.javaforschool.com
(b) The foll o\Ving fu nct ion witty( ) is a part of some class . What will be the 151
outp ut of the function witty() when the val ue ofn is " SCIENCE" a nd the value
orp is 5. Show the dry run I working: <> ' \ '-~ '> l

void witty(String n, illt p )


{
if (p < 0)
System .o llt.printlnC");
else
System.out.println(n .charAt(p) + ,.. " );
witty(n, p-l) ;
System.out.print(n.charAt(p »;
}

PART - II
Answer seven questions in this parr, choosing t!tree questions/i'om
Section A, two ./i·om Section Band two/i'om Sec/ion C

SECTION - A
Answer any three questions.

Question 4

(a) Given the Boolean function: F(A,B,C,D) = L (4,6,7,10,11,12,14,15)

(i) Reduce the above expression by using 4 - variable K-Map, showing th e various 141
groups (i.e. octa l, quads and pairs).

(ii) Draw the IOf;ic gate diagram of the reduced ex press ion . Assume that th e 111
variables and th eir complemen ts are available as inputs.

(b) Given the Boolean function : F(P,Q,R,S) = 1t: (0,5,7,8,10,12,13,14,15)

(i) Reduce the above expression by using 4 - variable K-Map, showing the various 141
groups (i.e. octal , quads and pairs).

(i i ) Draw th e logic gate diagram of the reduced express ion . Ass ume that th e 111
variables and th eir complements are available as inputs.

3
1212-868A Turn over
© www.javaforschool.com
Question 5

The Principal of a school intends to select students for admission to class XI on. the
following criteria:
• Student is of the same school and has passed the class X Board Examination with
more than 60% marks.
OR
• Student is of the same school, has passed the class X Board Examination with less
than 60% marks but has taken active part in co-curricular activities.
OR
• 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 active part in co-curricular activities.
T Has participated in sports at the National level.

Output: X - Denotes admission status [I 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 [51:
expreSSiOn.
(b) Reduce X ( S, P, C, T ) using Karnaugh's Map. [5]
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, [2]
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. (2)
(c) Define the terms Contingency, Contradiction and Tautology. [31
(d) Consider tbe following truth table where A and B are two inputs and X is the output:
A B X
o 0 0
o 1
o 1
o
(i) Name and draw the logic gate for the given truth table. [2)
(ii) Write the POS of X(A,B). 11)

4
1212-868A © www.javaforschool.com
Question 7

(a) Define Multiplexer and state one of its uses. Draw the logic diagram for a 4: 1 [41
Multiplexer.
(b) State how a Half Adder is different from a Full Adder. Also give their respective uses. [3J
(c) Minimize the following expression using Boolean laws: [31
Q . ( Q' + P ) . R . ( Q + R )
Also draw the logic gate for the reduced expression.

SECTION -8
Answer any two questions.
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 [101
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 (int nn) parameterized constructor to assign
slze = nn
void inputarray( ) to accept the array elements
void sort( ) sorts the elements of combined array
in ascending order usmg the
selection sort technique
vo id 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.

5
1212-868A Turn over
© www.javaforschool.com
Question 9

Design a class VowelWord to accept a sentence and calculate the frequency of words that (101
begin with a vowel. The words in the input string are separated by a single blank space
and tenninated 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 legal initial value

void readstr() to accept a sentence

void fre~ 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 maine ) function to create an
object and call the methods accordingly to enable the task.

© www.javaforschool.com
Question] 0

A happy number is a number in which the eventual sum of the square of the digits of the (101
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.c1ass 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:


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_sCLdigits(int x) returns the sum of the square of the
' digits of the number x, using the
recursive technique

void ishappy( ) checks if the given number is a happy


number by calling the function
sum_sCLdigits(int) and displays an
appropriate message

Specify the class Happy gIvmg details of the constructor( ), void getnum(int),
int sum_sq_digits(int) and void ishappy( ). Also define a maine ) function to create an
object and call the methods to check for happy number.

7
1212-868A Turn over
© www.javaforschool.com
SECTION -C
Answer any two questions.
Each Program / Algorithm should be written in such a way Ihal it dearly depicts the logic of
the problem step vvise. This can also be achieved by using pseudo codes.
(F lowcharts are not required).
The programs must be written in Java.
The Algorithm must be written in general/standard form, whel'ever required.

Question II
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/instant variables:


lnk[ ] entity to hold the integer el'e ment s
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(int mm) . constructor to initialize max = mm ,
begin = 0, end = 0
void addlink(int v) to add an element from the rear index if
poss ible otherwise display the message
"OUT OF SIZE .. ."
int dellink( ) to remove and return an element from
the front index. if possible otherwis~
display the message " EMPTY ... " and
return - 99
vo id display( ) displays the elements of the entity

(a) Specify the class Link giving details of the constructor(int), void addlink(int), 191
int dellink( ) and void display( ).
THE MAIN fUNCTION AND ALGORITHM NEED NOT BE WRITTEN .

(b) What type ordata structure is the above entity? 111

8
1212-868A
© www.javaforschool.com
Question 12
A super class Detail has been defined to store the details of a customer. Define a ItO]
sub class Bill to compute the monthl y telephone charge of the customer as per the chart
given below:

NUMBER OF CALLS RATE


1 - 100 Only rental charge
101-200 60 paisa per call + rental charge
201 - 300 80 paisa 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
teLoo to store the phone number of the
customer
rent to store the monthly rental charge
Member functions:
Detail ( ... ) I 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 calC) calculates the monthly telephone
charge as per the chart 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 detail s of the constructor( ),
void cal( ) and void show( ).
THE MAIN( ) FUNCTION AND ALGORITHM NEED NOT BE WRITTEN.

9
1212-868A Turn over

© www.javaforschool.com
Question 13

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

class node
{
int p;
String n;
node next;
}

Write an Algorithm OR a Method to search for a name and display the contents of
that node. The method declaration is given below:

void search( node start, String b )

(b) What is the role of constants in complexity? Explain briefly with an example. [2J
(c) Answer the following from the diagram of a Binary Tree given below:

(i) External nodes of the tree. [1J


(ii) Parent of node D. [11
(iii) Inorder traversal of the tree. 111
(iv) Right subtree of Node B. 11J

10
1212-868A
© www.javaforschool.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy