0% found this document useful (0 votes)
15 views5 pages

Class 11 Half Yearly Computer Paperb. Bebhhe

Bbdbb.
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)
15 views5 pages

Class 11 Half Yearly Computer Paperb. Bebhhe

Bbdbb.
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/ 5

ST.

XAVIER'SINSTITUTION,(ani
HALFYEARLYEXAMINATION
CLASS- XI 1
SCIENCEPAPER I (THEORY)
SUBJECT-COMPUTER
MaximumMarks: 70
ThreeHours
TimeAllowed: minutes for only reading the paper.
15
(Candidates are alloved additionalwriting
NOT start during this time.)
They must
Part I (compulsory) and six questionsfrom Part-Il
Answer all questions in two from Section-Band
choosing two questionsfrom Section-A,
twofrom Section-C.
be done on the sSame sheet as the
All working, including rough work should are given in brackets [].
The intended marks fo questions or parts of questions
PART I-20MARKS
Answer all questions.
While answering questions in this Part, indicate briefly your working and reasoning,
wherever required.
Question l: [10 x 1 = 10]
(0) Which one of the following symbols represents disjunction operation?
b.
C.

(ü) Contra positive o` conditionalis


a. a' ’b
b. ba'
C. b a
d. b'’ a' b,a
(ii) Complement of AA0 is
a. tautology
b. contradiction
C. contingency
d. equivalent
(iv) The Boolean expession for a two variable XNOR gate is
A. A'.Bt A.B'
b. A'.B'+ A.B'
C. A.B+ A',B
d. A'.B' +A.B
() Which gate is rerresented by this diagram
4. OR
b. NOR
C. XORV
d. XNOR

1
0 when all inputs
are 1?
(vi) outputis
In which of following gatesthe
a) AND the
b) XOR
<) NANp
d) OR
(vii) obj of StringTokenizer class where the
Write a JAVA statement to create an object
are space, comma, question mark and full stop.
String variable is 'str' and the delimiters
(vii) of type double having
eaJAVAstatement to declare a two dimensional array 'arr'
Seven rows and four columns
(ix) What will be the first and last index of a single dimensional aray of size 20
IHAIL (x) Predict the output if variable s-"PANJHATP
System.out.printtn(s.substring(s.indexOf(I'))
Question 2: ?

(i) Write the equivalent Java statement for the following


expression (2J

(ii) Define a String array 'colour' storing the colour names Violet,
Yellow, Orange and Red Indigo, Blue, Green,.
[2]
(ii) The following function isa part of some class
of anumber 'p' raised to the power q' (p). which computes and returns the value
marked by ?1?,?2?,?3? which must be There are some places in the code
that the function works replaced by an expression / a statement so
correctly.
double power ( double p, int q)
Ldoubler=?1?,
int c =(q<0)?-4:q3
if(q =0)
return 1:
else
{for (int i =I;i=c;?, i++);
return (q>0)? r:?3?;

a. What is the expression or statement at ?1?,?2? and ?3?


(3]
(iv) The following is a function of some class. It
otherwise it returns 0. [A perfect number is returns 1 if the number is a
a number which is equal to perfect number
factors other than the number itself. ] the sum of its

int perfectNo(int n)
{int sum=0;
for(int j=1;?17:j++)
(i(727)

return ;
clse
return 0;}
2
PARTII-S MARNS m

SECTION-A

opertions /comesis
Quesin3Perfara the foiowing
b. (ACET Ocz
1's complemet nehnJ
c 10010, -1100110, [Usng
& 7CE9,+ 11FABs
e. 6214 - 347,
-i}
Question 4:
wrie the Boolen ressionofa tw12ribe NCR
a Dras hetrh table and
of the folowng Bocleam agresSica
b. Drzw the logic cicit iagza
LY +KYZ) ?1?.2?d3!
Jogic circut paied 2s
. WritetheBoolean expression of the

gate and XNOR gate


C. Differentiate between XOR
cortadiction or
following expression isa tautology.
Proveusing truth table whether the
a. contingency (3]
(a Abac)an~bAc)
positive for the following conditional
b Wríte the (i) converse (ii) inverse (iii) contra
intelligence" (3]
"Ifa machine can thínk then it has artificial
X+Y
c. Draw the truth table of (21
truth table XY= X'+Y
d. Prove using

SECTION-B
Answer any two questions.
of the problem
a way that it clearly depicts the logicprogram,
Each program should be written in suchmnemonic names and comments in the
This can be achieved by using
(Flowcharts and Algorithms are not required.)
written in Java.
The programs must be
[10]
Question 6: which are sorted1(to pack means to remove
Define aclass Duplicate to pack an array of 10 integers
all duplicates from the array). sorted numbers: 123344456623456
given array has the following be: 1
For eg If the each element once. The output should
The resultant array shouldcontain given below:
Someof the mmbers of the class are
Class name : Duplicate

3|
Data members
num[] :
size : integer array with 10 sorted integers.
to store the size of the array
Member functions:
void readList():
void packList(): to enter elements of the array in sorted order.
void dispList() : to remove duplicates from the array.
to display the array of integers without any duplicates.
Specify the class Duplicate the details ofthe functions void
Void dispList(int). Also defnegiving
the main function to create an,object readList(), void packList() and
and call methods accordingly to
enable the task.
Question 7:
A class called Matrix is defined to find the sum of the [10]
a5x5 matrix. The details of the boundary elements and product of diagonals of
class is given beloW:
Class name: Matrix
Member data
int a)): A integer matrix of size Sx5
int sum: To store the sum of the boundary elements of the matrix
int prol,pro2 To store the product of the two diagonals
Member method
void accept(): To enter numbers in matrix a[0
void sumboundary(): Calculates and prints the sum the boundary elements of the matrix
void product(): Calculates and prints the product of the two diagonals
Specify class Matrix giving details of the void accept(), void sumboundary() , void product().Define
the main() function to create an object and call the functions accordingly to enable the task.
Question 8:
Input a sentence from the user and count the number of times, the words "AN" and[10] AND" are
present in the sentence. lt also stores the sentence in reverse order and prints it. For example if the
Sentence is YOU SHOULD EAT AN APPLE AND AN ORANGEEVERY DAY" then the output
will be
Frequency of AN =2
Frequency of AND=1
Peverse order = DAY EVERY ORANGE AN AND APPLE AN EAT SHOULD YOU
Design a class Frequency using the description given below:
Class narme : Frequency
Data Members
text: stores the sentence
countand : tostore the frequency of the word AND,
Countan : tostore the frequency of the word AN.
revstr : store the words in reverse order
Jen : length of the string
Member functions
constructor to initialize the data variables.
Frequency0:
void accept(String n) : to assignnto text in upper case
Using StringTokinezer extract cach word and frequency of and &an
voidcheckfreq) :
separately
to storethe words in reverse order in String revstr.
void reverseword() : to display the frequency of"an"'and "and"" and reverse string with
void display0: suitable messages,
Specify class Prequency giving details ofthe constructor(), void accept(String), void checkfreg),
yoid reverseword() and void display(). Also define the main function to create an object and call
methods accordingly to enable the task.
SECTION-C
questions.
Each programn should be written inAnswer
Iwo
clearly depicts the logic of the problem.
such aany
Way that it and comments in the program.
This can be achieved by using mnemnonic names
not required.)
are
(Flowcharts and Algorithms writtenin
Java.
The programs must be
(5]
Question 9: which will sort an integer array af ] of size
Write only a method in Java void sort(int al , int len) Assumetha the other codes are already
len in ascending order using Insertion Sort Techniq que.
written
[5]
which will search if the
Question 10: int size, int num) variable size denotes the size
search(int a<|[l,
Write only a nethod in Java void dimensional. array a[0 or not. The position is displayed other
number 'num is present in the two corresponding row and column
is found then the that the other codes are already written
of thearray. Ifthe number
found" is printed. Assumme
wise "Number not
[5]
'num" of base 10 (decimal) to its
Question 11: convertOct(int num) to convert a
Write only the method void that the other codes are
already written
corTesponding octal form. Assume

You might also like