Computer SC Specimen QP Class Xi
Computer SC Specimen QP Class Xi
PAPER 1
(THEORY)
(Maximum Marks: 70)
(Time allowed: Three 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)
Answer all questions.
While answering questions in this Part, indicate briefly your working and reasoning,
wherever required.
Question 1
(a) Draw the truth table to represent a two input XOR gate. [1]
(e) If A denotes “it is cloudy” and B denotes “it will rain”, then express the following [1]
statements in symbolic form:
Question 2
(b) Convert the following arithmetic expression into Java statement [2]
x = (a5 + b7)/ √ab
(c) Define the term ‘wff’ in propositional logic. Give one example. [2]
-----------------------------------------------------------------------------------------------------------------------------------
1
Question 3
The following is a method/function of some class. Give the output of the function [5]
perform( ) when the value of ‘n’ is 6579. Show the dry run/ working.
void perform( int n )
{
int s=0, g;
while( n>0)
{
if (n%2==1)
n/=10;
g=n%10;
System.out.print(“\n g = \t” + g);
s=s+g;
n/= 5;
}
System.out.print(“\n s = \t” + s);
}
(a) The Planning Committee of a particular town consists of a President, Secretary and [5]
a Treasurer. Any decision taken on development plans of the town can be
implemented only if :
INPUTS
Output: X - Denotes development plan [1 indicates agreed and 0 indicates refused in all
cases ]
Draw the truth table for the inputs and outputs. Also, write the Boolean expression with
conjunctive operators for each of the true values (1’s) from the output column of the
truth table.
(b) Prove the following Boolean expression with the help of a truth table: [3]
A B = (A B)′
(c) What are Universal gates? Draw the AND gate using universal gate. [2]
Question 6
(a) Define Half Adder. Write the expression and draw the logic diagram for a half adder. [5]
(c) Draw the logic circuit for the following Boolean expression: [2]
X = (A′ + B) . (C + D′)
-----------------------------------------------------------------------------------------------------------------------------------
3
Question 7
Design a class WordWise to separate words from a sentence and find the frequency of the [10]
vowels in each word.
Some of the members of the class are given below:
Member functions/methods:
Define the class WordWise giving details of the constructor( ), void readsent(),
int freq_vowel(String) and void arrange(). Define the main( ) function to create an object
and call the functions accordingly to enable the task.
-----------------------------------------------------------------------------------------------------------------------------------
4
Design a class PrimePalinGen to generate prime palindrome numbers. [ A number is said [10]
to be prime palindrome if the number is a prime as well as a palindrome number ]
[ Prime number: A number having only two factors i.e. 1 and itself ]
[ Palindrome number: A number which is same as its reverse ]
Example: 11(where 11 is a prime number and a palindrome number)
Some of the members of the class are given below:
Methods/Member functions:
Specify the class PrimePalinGen giving details of the constructor( ),int isPrime(int), int
isPalin(int) and void generate( ). Define a main( ) function to create an object and
call the functions accordingly to enable the task.
-----------------------------------------------------------------------------------------------------------------------------------
5
A class ArrayMax contains a square matrix which finds the largest element in each row. [10]
Some of the members of the class are given below:
Member functions/methods:
void large( ) : finds and displays the largest element in each row
with an appropriate message
Specify the class ArrayMax, giving the details of the constructor( ), void readarray( ),
void large( ) and void display( ). Define the main( ) function to create an object and call
the functions accordingly to enable the task.
SECTION – C
Answer any two questions.
Each method should be written in such a way that it clearly depicts the logic of the problem stepwise.
This can be achieved by using mnemonic names and comments in the program.
(Flowcharts and Algorithms are not required.)
The methods must be written in Java.
Question 10
(a) Write a Method to calculate and return the sum of the square of the digits of a number [4]
‘n’ using recursive technique.
The method declaration is as follows:
int sumSq( int n )
(b) State any one difference between recursion and iteration. [1]
-----------------------------------------------------------------------------------------------------------------------------------
6
(a) A binary file named “ABC.DAT” contains the product code (pc), unit price (up) and [4]
quantity(q) for number of items.
Write a Method to accept a product code ‘p’ and check the availability of the product
and display with an appropriate message.
The method declaration is as follows:
void findpro( int p )
(b) State any one difference between binary file and text file. [1]
Question 12
(ii) Which statement comes automatically in each class of a user defined package? [1]
-----------------------------------------------------------------------------------------------------------------------------------
7