LAMARTINIERE FOR B0YS,
KOLKATA
REHEARSAL EXAMINATION 2022-23
SUBJECT: Computer Application TIME: 2 hours + 15 minutes reading time
CLASS: X
F.M- 100
Ancwers to this paper must be written on the paper
Va will not be allowed to write provided separately.
during the first 15 minutes
Thic time is to be spent in reading the
question paper.
The time given at the head of the question paper is the time allowed for
writing
theanSwers.
This Paper is divided intotwo sections.
Attempt all questions from section Aand any four questions from section B.
The intended marks of the questions or part of the question are given in [J.
SECTIONA
Attempt all questions from this section
Ouestion 1: Choose the correct answer and write the correct option (20]
i. The token "break' is a in Java
a. keyword
b. identifier
C. literal
d. constant
i If any variable is preceded by the keyword static, then the variable is
a. Instance variable
b. Local variable
C. Class variable
d. Final variable
10-comp.app-1/10 (LMB)
Which koywordrepresents thecurrent object in the mernber method
il, thi,
b. new
C. final
d, static
iv. The package of which theString class is a part of
a. java.util
b. java.lang
c. java.math
d. java.io
What will be the output of the following Java code:
String str-deep";
String str1="deeper";
System.out.printin(str.compareTo(str1));
a, 1
b. -32
C. -2
d. 32
vi. Thefunction which checks whether acharacter is a digit or not is
a. isLetter()
b. isDigit()
C. isUpperCase()
d. islowerCase()
10-comp.app-2/10 (LMB)
vi. In the array int x[|={(2,3,10,2, 1,9}, the statement x(2]*x\4] willbe equal
to
a. 3
b. 18
C. 10
d. 4
vi. The parselnt() function is a member of
a. Boolean wrapper class
* b. Integer wrapper class
C. Double wrapper class
d. Float wrapper class
object of its
conversion of a primitive data type into an
ix. The automatic
as:
equivalent wrapper class is known
a. Unboxing
b. Coercion
C.
Autoboxing
type Conversion
d. Explicit
statement is
the value of p' after the following Java
What would be
X.
executed
intd=8
4)+d;
int p=(d++ *
a.
42
b. 32
41
C
d. 39
10-comp.app-3/10 (LMB)
Xi. Which of the following is not a jump statement
a. break
b. return
C. continue
d. void
xii. Which of the following is the ternary operator
a. >>
b. <<
C. &&
d. ?:
xii.
The output of the Javastatement Math.round(Math.sqrt(6.25)) will be
a. 2
b. 2.5
C. 3
d. 3.0
xiv. The mechanism in which one class acquires the features of another class
is called
a. Inheritance
b. Polymorphism
C. Abstraction
d. Encapsulation
XV. Which of the following causes abnormal termination of a program
a. break
b. return
C. System.exit(0)
d. Continue
10-comp.app-4/10 (LMB)
Xvi. What willbe the output of the following Java code snippet
int arr[|={12,14,16,18,20};
for(int i=0;i<5;i++)
System.out.print(arr[i+}+"\");
a 12 16 20
b. 14 1820
C. 12 14 18
d. 14 16 18
xvi. Which of the following is not a propertyof a constructor
a. Constructors can be private
b. Constructors initialize the data members with default values
C. Constructors do not have any return type
d. Constructorsare invoked automatically when an object iscreated
xvii. Thenumber of bytes occupied by the literal 76.87 is
a. 2
b. 6
C. 8
d. 16
X0X. Which of the following is not a primitive data type
a. int
b. double
C. char
d. arrays
particular class
XX. Which keyword is used tocreate an object of a
a. static
b. final
C. new
d. break
10-comp.app-5/10 (LMB)
Question 2:
i. State the value of c if the value of a is 4 and the value of b is 5 (2)
C=b* a++ -++a * b++ + ++b * a- -
ii. Rewrite the following Java statement using ternary operator (2]
if(cp>sp)
str="loss":
else
str="profit";
iii. Give an example of constructor overloading [2)
iv. What will the following Java code display [2]
int arr[]={23,34,56,21,45);
System.out.printin(Math.min(arr[2],arr[1]);
V. Write the Wrapper classes for 'int' and 'double' primitive data types
respectively (2]
vi. Write the Java statement for the following expression
ut';at
vii. Evaluate the value of the variable c in both the cases (2]
i. boolean c=5+3/4>10&& 10*2/5>0;
i. intc=p*q+p+2/q-1+p++(value of p=2 andvalue of qis 3)
viii. What do you mean by entry controlled loop? (2)
ix, What will be the output of the following Java code snippet (2]
char ch=a';
boolean k=Character.isUpperCase(ch);
System.out.println(k);
10-comp,app-6/10 (LMa)
X. What will be the output of the following Java code snippet (2|
int a='B',b='A';
System.out.printin(a+b);
SECTIONB
(Answer any four questions from this sectlon)
The answers in this section should consist of the programs in either Blue!
environment or any program environment with Java as its base.
Each program should be written using variable description/mnemonic codes
so that the logic of the program is clearly depicted.
Flowcharts and algorithms are not required.
Question 3: |15|
Define a class with the following specification:
Class name : Library
Datamembers/instance variables:
bno-number of the book
bname -name of the book
cays- number of days for which the book has been issued.
data
Tine- amount of fine to be paid. [Declare the variables using appropriate
types]
Member Methods
the data members with
Lorary()- non pararmeterized constructor to initialize
default values.
and days usiny scanner class
OId input()-accept the bno,bnarne
on the nurnber of days for which the
Void calculate ()--calculates the firne based
book has been issued.
19Fhmp.app 1/10 (1)
Days Fine(in Rs)
Upto 10 days
For the next 10 days Rs.0.5 per day
For the next 10 days Rs 1 per day
Above 30days Rs.2 per day
void display() Displays the details in the following format
bno bname days fine
XXX XXXXX XXXX XXX
Question 4:
(15]
Design a class to overload the function num as follows:
void num() to print the format
7 7
5 5
3 3 3
1 1 1 1 1
void num(int n)- calculates and displays the sum of the first and the last digits
of the number n'
void num(double n) calculates and displays the sum of the series:
1.5 + 2.0 + 2.5+3.0 +... +n
Question 5:
(15]
Write a program to input 20words in an array. Convert each word to
uppercase.
Then input a letter in uppercase and print those words which starts and ends
with that letter. Also print how many words got printed?
Input:
ANA
RAVI
BOB
ARITRA.....etc.
10-comp.app-8/10 (LMB)
Enter the Character:A
Output:
ANA
ARITRA
Total words printed:
Question 6: [15)
Using switch case write a menu driven program to do the following
Option 1: To accept a name and print it in the folowing format
Sample Input: SACHIN RAMESH TENDULKAR
Sample Ouput:S RTENDULKAR
Option 2: To accept a word and convert to lowercase and then make a new
string in the format [first all the vowels and then the consonants]. Print the new
formed string
Sample Input: Computers
Sample Output : ouecmptrs
For an incorrect choice display a suitable message
Question 7: (15)
array. Convert all the letters to
VWrite a program to input n letters in an
order using bubble sort
uppercase and then sort the array in ascending
technique. Print the sorted array.
10-comp.app-9/10 (LMB)