100% found this document useful (2 votes)
539 views11 pages

Computer Application - Rehearsal Examination - 2023-24

The document provides information about a computer applications rehearsal examination for modern high school girls. It is divided into two sections with Section A containing 16 multiple choice questions worth 40 marks total. Students must attempt all questions in Section A and can choose 4 questions from Section B. They have 2 hours to complete the paper and the first 15 minutes are for reading only.

Uploaded by

Arko Sarkar
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
100% found this document useful (2 votes)
539 views11 pages

Computer Application - Rehearsal Examination - 2023-24

The document provides information about a computer applications rehearsal examination for modern high school girls. It is divided into two sections with Section A containing 16 multiple choice questions worth 40 marks total. Students must attempt all questions in Section A and can choose 4 questions from Section B. They have 2 hours to complete the paper and the first 15 minutes are for reading only.

Uploaded by

Arko Sarkar
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/ 11

MODERN HIGH SOfOOL FOR GIRLS

REHEARSAL EXAMINATION 2023-24


CAS S10

COMPUTER APPLICATIONS

TOTAL MARKS: 100


TIME: 2 HOURS
ided separately.
Answers to this Paper must be written on the pape
r prov

You will not be allowed to write during the first 15


minutes.
r.
This time is to be spent in reading the question pape
allowed for writi ng the
The time given at the head of this Paper is the time
answers.

This Paper is divided into two Sections.

Attem pt all questions from Section A and anyfour


questions from Section 8.

tions are given in brackets[}.


The intended marks for questions or parts of ques

SECTION A (40 marks)

(Attempt all questions from this Section.)

(20)
Question 1
given options.
Choose the correct answers to the questions from the

(Do not copy the qu~ on, write the correct answers only.)

picture:
(i) Name the feature of Java depicted in the following

Page 1 ofll
(a) Abstraction
(b) Encapsulation
(c) Inheritance
(d) Polymorphism

owing:
(ii) Predict the out put of the foll );
5,0.5) + Math.floor(2.03-17 .59)
System.out.println( Math.pow(62
(a) 41.0
(b) 9.0
(c) 9
(d) 10.0

t a correct statement?
(iii) Which of the foll ow ing is no y.
new ope rat or to initialize an arra
(a) It is always necessary to use d by curty
be init iali zed using com ma separated expressions surrounde
(b) Array can
braces.
me mo ry can be allo tted in one
statement.
(c) Array can be declared and
t.
(d) All the statements are correc
method name, what
the re are mu ltip le definitions of the method wit h the same
(iv) When answer}
diff ere nt fro m eac h other? [Choose the mo st app rop riat e
makes the m
(a) Method prototype
(b) Method signature
(c) Method name
(d) Method body

Page 2 of 11
(v) Choose the odd one:
(a) ==
{b) <=
(c) 11
(d) I=

(vi) If m=9 and n=6, calculate the value of the following expression.

m-=m++ --n+m
(a) -5
(b) 5
(c) O
(d) 20

(vii) Consider the following string array :


String s[]={" ABC","WXYZ","QWERTY"};
What will be the value of: s.length + s(2].length()
(a) 6
(b) 5
(c) 7 •
(d) 9

(viii) What are the extensions of the Java source code and byte code flies?
{a) .java and .byte
(b) .java and .obj
(c) .Java and .class
(d) .java and no extension(because the bytecode is not stored In the form of flle)

(ix) What will be the output of the following code snippet?


char x='l', y='2';
System.out.prlntln( x -v + x );
(a) 48
(b.) O
(c) 1-2 + 1
(d) 1

Page 3 of 11
the correct answer:
(x) Read the following text and ' h oose
embers permitted by each modifier.
The following table shows the access to m

I Access Levels I
j Modifier ]~~ackag~~ubclas~[world]
jpublic ID[v ]fr ][:]
JD~ ]~ ]~
ir j
jprotected
jno modifier j[N
jprivate \~=:JIN ](N ]N
The first data column indicates whether the class itself has access to the member defined
by the access level. As you can see, a class always has access to its own members. The
second column indicates whether classes in the same package as the class (regardless of
their parentage) have access to the member. The third column indicates whether
subclasses of the class declared outside this package have access to the member. The
fourth column indicates whether all classes have access to the member.
[Source: The Java Tutorials (Oracle Official w~bsit~}}

Through this type of access modifier, the members of the class are accessible to the same
class or package or subclasses in different package but not to any other class or package.

(a) public
(b) protected
(c) default
(d) private

(xi) Which one of the following code segment iterates infinitely?


(a) for(k=l;k<=lO;k++)
{ System.out.print(k+" 11 ); }
(b) for(k=10;k<1;k++)
{ System.out.print(k+" "); }
(c) for(k=1;k>=1;k++)
{ System.out.print(k+" "); }
(d) for(k=10;k>1;k-)
{ System.out.print(k+" "); }

Page 4 of 11
(xH)What ls the final value of ctr h h .
w en t e iteratio n process given below executes?
Int ctr--0;
for(lnt 1=1;1<=5;1++)
for(lnt J=1;J<=S;J+=2)
ttr=c:tr+l;
(a) 25
{b) 10
(c) 1
(d) 15

(xiii) What will be the output of the following code segment?


System.out.println(1+String.value0f(2).concat("3"));
(a) 24
(b) 15
(c) 123
(d) Syntax error

(xiv) Assertion(A): Integer i = new lnteger{5);

Reason(R): Autoboxlng Is the automa •


tic conversion that the Java compller
makes between the primitive types and their corresponding object
wrapper classes. For example, converting an Int to an Integer,
a double to a Double, and so on.
[Source : The Java Tutorials (Oracle Official wtbslte)J
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct ~lan1t
1on
of Assertion (A)
(b) Both Assertion {A) and Reason {R) are true and Reason (R) Is not
a correct
explanation of Assertion {A)
(c) Assertion (A) is false and Reason {R) is true
(d) Assertion (A) is true and Reason (R) Is false

(xv)Whlch of the following statements ls not true?


(a) A constructor is a block of codes similar to the method.
(b) A constructor has to be invoked explicitly l\ke a method is invoiced.
(c) A constructor is a special type of method which is used to Initializ
e the lnstanct
variables of the object.
(d) The constructor does not have a return type, not even void.

Page 5 of 11
n,
(xvi) Arrange the following variables according to their size In memory l•scet\d1
order).
Iona 1&•5;
boolean bl=true ;
char ch::'9'; float ft=2.05f;

(a) bl ch ft lg
(b) ch bl ft lg
(c) bl ft lg ch
(d) ch ft bl lg

(xvii) Which of the following can be used for a variable name in Java?
(a) A-to-Z
(b) 2023Java
(c) static
(d) Class

(xviii) Assertion(A): Size of the array can be changed after it is declared or lnlttallzed.
Reason(R): Java array is an object which contains elements of a similar data
type. The elements of an array are stored in a contigu ous memo ry
location. •

explan ation
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct
of Assertion (A)
not a correct
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is
explanation of Assertion (A)
(c) Assertion (A) is false and Reason (R) is true
(d) Assertion (A) is true and Reason (R) is false

(xix) Name the type of the error, if any in the followin g statement:
double discount=40/100*price;
t and the
[Here, price is a double type variable which stores the price of a produc
409' discount is given on
above statem ent is used to calculate the amoun t of discount when the
the produc t]

(a) Syntax error


(b) Logical error
(c) Run-tim e error
(d) There is no error in the above statement

Page 6 of 11
(xx)What will be the output of the following code segment?
Int arr[]= { 0, -1, -2, -3, -4, -5, -6, -7};
for( Int z = 5 ; z > 2 ; z •= 2) {
System.out.prlntln( arr[-z1 ); }
(a) -s, -3, -1
(b) -4, -2, O
(c) -4
(d) -4, -2

Question 2
(I) What will be the output of the following code snippet (show the steps)? (2)
Int a1=4,a2=5,a3=6;
boolean f;
f = al - a2 • a3 >= 2 && a3 +al I= Math.abs(a1-a3);
System.out.prlntln(f);

(ii) Write a Java expression for: ax30 + bx15 ( .Jy - 6) (2)


{Here, a, b, x and y are individual variables]

(Ill) Consider the following class: [2]

class ldentffyParts
{
double dd=34.01;
static Int xx=10;
lntyy=23;

void dlsplay(lnt aa)


{
Int bb=aa;
} .
}
(a) Identify the insta.nce variable(s).
(b) Identify the class varlable(s).
(c) Identify the parameter(s).
(d) Identify the local variable(s).

(Iv) "A class Is a named representation for an abstraction." - Comment.. {2}

Page 7 of 11
puter Applications..,. Howe
ver, tht r,
. . tis used to display NCom modified cod e. Wh td,
WJ ng ~e snappe ·ty the error(s) and rewrite the [ )
(v) The follO Rect1 2
is/are error(s) in the code.
of err or is It?
double choice=1.0;
switch(choice)
mputer ");
{ case l.O: System.out.prlnt("Co
Appllcatio ns");
case 2.0: System.out.prfnt("
break;

rong choice");
default: System.out.println("W
}

(2]
the foll ow ing 20 array:
(vi) Consider }, {7,8,9} };
Int array[]a ={ {1, 2,3 }, {4,5~6 d ou t the sum of the
a single Java sta tement using the index positions to fin
(a) Write
diagonal of the 20-array.
elements placed on the right
ay given above?
(b) What is the size of the arr

cuted? (Show the


l be the value of dif f when the following code is exe
(vii) What wil (2]
stt!ps)
l String sl="Human intelligen
String s2="Artificial Intellige
ce";
nce";
int diff=sl.substring(6).com
pareTo(s2.substring(11,15));

the Character
ase () me tho d is de fined in the String class as well as
(viii) The toLowerC of the toLowerCose( )
Wr ite any 2 differe nce s between these tw o types
wr ap pe r class. (2]
h the he lp of exa mp les.
me tho d wit

exampie.
ove rlo ad ing be achieved? Explain wit h the help of an
r
(ix) Ho w can the constructo [2]

n as parameters
me d po we r() wh ich accepts 2 integer variables a and
(x) Wr ite a me tho d na
ue of a" wit ho ut using
an int eg er value . Th e method calculates the val
an d returns [21
/Full pro gra m Is no t needed]
Ma th. po w( ).

Page 8 of 11
I

SECTION B (60 marks)


(Answer any four questions from this Secrlorl.J

The answers in this section should consist of the programs in eitMr Blue.J
environment or any program environment with java as the base.

Each program should be written using variable description/ mMmonic codes so


that the logic of the program is clearly depicted.

Flowcharts and algorithms ore not required.

,~estton3 llSl
A car rental company rents out 4-wheeler cars on hourly basis. Define a class with the foUowing
specifications:

Cass name: CarRental


Member variables:

name - name of the customer

driving_license - It is a 15 characters stritlg (e.g. W80220120001234)

hr - hours for which a car has been taken on rent

bill - amount to be paid by the customer

[Declare the variables using appropriate data types}

Member methods:

void accept( ) - accept name, driving license and hours using methods of Scanner da~s.

void calculate( ) - Calculate the bill amount to be paid by the customer as per the foltow\nt
criteria:

Hours Amount
First 5 hours Flat charge 7000
Next 3 hours 1500 per hour
Next 2 hours 1200 ~er hour
I
Over 10 hours , 1000 per hour l

If the bill amount is" 10,000 or more, then either a discount of 20% or flat~ 2500 (whkh~ \,
minimum) is applied.

Page 9 of 11
details in the follow ing format:
void print( ) - Display the Bill Am ou nt
Rent Time
Customer Name Driving License

object.
ds in main method using an
Call all the above metho

(15)

_JIGestton 4 Pa ng ram or
nv ert it to up pe rcase . Check wh eth er It Is a
a sentence. Co
Design a dass to accept let ter of the alphabet is used at least
once.
nce in wh ich every
no t. A Panaram is a sente
ov er a lazy do g
le Inp ut: Th e qu ick bro wn fox jum ps
Samp
It is a Pangram
Sample Output:
least once]
I A - Z all alphabets are present at

ps ov er a dog
Sa mp le Inp ut: The qu ick bro wn fox jum

Sa mp le Ou tpu t: It is no t a Pangram

(1S)
Question 5
ing order usin&
s in a do ub le- typ e array. Sort them in ascend
N value
Define a class to accept array.
e and display the sorted
Selection Sort techniqu

{151
ye st io n 6 ximum value of
o a 3x3 array of int eg er typ e. Display the ma
values int
Define a class to accept
value of each column.
each ro w and mi nim um

Page 10 of 11
7
/uestf on
(15]
Write a program to input an Integer and check Whether It is an Armstrong number or not.
An
digits.
Armstrong number is a positive n-digit number that is equal to the sum of the n powers of their
th
Example:
9 '? !Jl = 9 (Armstrong number)
153 13 +53 +33 = 153
(Armstrong number)
371 33 + 73 + 13 = 371
(Armstrong number)
1 +6 + 34 +44 = 1634
4
1634 4
(Armstrong number)
92727 25 + ]5 +25 + ]5 = 92727
(Armstrong number)

(Not on Armstrong number)

Question 8
(15]
Define a class to overload the metho
d pattern( ) as follows:
(
void pattern char x,char y) - Display the following pattern.
'@' d
Sample values: x= • on y='$'
Output: (Ip
§)$
(§1$(11
@$(11$
1)$@$(§1
(§1$(11$@$

• ) - Display the sum of the following pattern.


void pattern(int n 1 1 1 ........... upto n terms
1 • +---
sum =4 8 12 16 ...................

Wrrte
• a ma,·n method to create
• an o bJ"ect of the class and invoke t he member methods.

[This• quesu
"on paper consists
• 'J 11 printed sides.]
of

Page 11 of 11

You might also like