MOUNT ACRMEL SCHOOL
FIRST PRE-BOARD EXAM 2021-22
COMPUTER APPLICATION
Maximum Marks: 50
Time allowed : One hour (inclusive of reading time)
Each question carries 1 mark
ALL QUESTIONS ARE COMPULSARY
SECTION A (30 Marks)
1. A constant which gives the exact representation of data is called
a. Variable b. Literal c. Identifier d. Character
2. The Unicode of lower case alphabets range from
a. 65 – 90 b. 60-85 c. 97 – 122 d. 65 – 96
3. Which of the following is non-primitive data type
a. long b. byte c. String d. boolean
4. Which of the following keyword is used to refer to the object which invoked the function
a. new b. class c. this d. None of these
5. What is the final value stored in variable x?
double a = -18.02;
double x = Math.abs(Math.floor(a));
a. 19.0 b. 18.0 c. -19.0 d. -18.0
6. Name the type of error in the statement given below:
int r = 10/ (5 – 5);
a. Syntax b. Runtime c. Logical d. None of these
7. The ______ allows a class to use the properties and methods of another class
a. Inheritance b. Polymorphism c. Encapsulation d. Static
8. The number of bytes occupied by long data type is ____ bytes
a. 2 b. 4 c. 8 d. 16
9. The statement n +=4 is equivalent to
a. ++n b. n=n+4 c. n+4 d. none
10. int m, p; m = 5; p = 0; p = m-- + ++m; the value of p will be:
a. 11 b. 10 c. 8 d. 12
11. The ______ is called an instance of a class
a. Object b. Attributes c. State d. None of these
12. Method that accepts a character and returns its Unicode value as int
a. nextInt( ) b. readLine( ) c. read( ) d. next( )
13. Intermediate code obtained after compilation
a. Byte code b. Source code c. Object code d. None of these
14. The method with the same name as of the class and which does not have a return data type is called as
a. Function b. member Variables c. Constructors d. None of these
15. The statement to terminate the execution of a construct
a. System.exit(0) b. break c. STOP d. destructor
16. Invoking a function by passing the objects of a class is termed as
a. Call by value b. call by reference c. call by method d. None of these
17. What type of value is returned by Math.rint( ) ?
a. int b. double c. float d. short
18. Package in which System class is defined
a. io b. lang c. util d. None of these
19. Which of the following statement accomplishes a ‘fall through’ ?
a. if-else-if b. switch c. for loop d. do-while loop
20. When the execution of statements are repeated sequentially a number of time, the construct is known as
a. Sequence b. Selection c. Iteration d. Conditional
21. Which of the following statement creates multiple branching:
a. loop b. continue c. switch d. break
22. Find the odd one
a. System b. Scanner c. Math d. String
23. Find the odd one
a. void b. int c. boolean d. static
24. Find the odd one
a. int b. double c. char d. boolean
25. Find the odd one
a. + b. % c. / d. ||
26. Give the output of the following
x += x++ + ++x + --x + x; [ x = 5 ]
a. 29 b. 28 c. 26 d. 25
27. Give the output of the following
if ( a > b )
System.out.print( a + b);
System.out.print( a * B ); when a = 5 and b = 7
a. 12, 35 b. 35 c. 35, 12 d. None of these
28. Give the output of the following
String x = (a >= 90 ) ? “excellent” : “ best “ ; when a = 90
a. best b. excellent c. excellentbest d. None of these
29. n = 1000;
while (n > 10)
{ n = n / 10; }
System.out.println (n );
How many times the loop is executed and what is the output?
a. Loop is executed 2 times and the output is 100
b. Loop is executed 3 times and the output is 10
c. Loop is executed 2 times and the output is 10
d. None of the above
30. For how many times the given loop statement be executed:
for( i = 10; i < 10; i++)
Statement
}
a. 1 time b. 10 times c. infinite d. none
SECTION – B (20 Marks)
Question
Given below is a class with the following specifications:
Class name : OverLoad
Member Methods
void print ( int n ) – to print first ‘n’ natural numbers
boolean print ( int m, int n) – to check whether n is a multiple of m or not
Fill in the blanks of the given program with appropriate java statements listed below
class _____(31)____
void print (int n)
int k;
for(___(32)___ ; ____( 33)__ ; ___(34)__)
System.out.println( k);
boolean print( int m, ____(35)___ )
if ( ____(36)____)
return true;
else
return false;
}
31. a. OVERLOAD b. Overload c. OverLoad d. overload
32. a. k=1; b. k = n; c. k = 0; d. None of these
33. a. k <= n; b. k>=n; c. k==n; d. k!=n;
34. a. K+=2 b. k-=2 c. k++ d. k--
35. a. int n b. int n; c. char n; d. double n
36. a. n/m == 0 b. m/n==0 c. n%m==0 d. m%n==0
Question
The following program is based on the specification given below. Fill in the blanks with appropriate java statements
listed below
class name : Telephone
member variables : int noc [number of calls]
double bill [ telephone bill to be paid]
String n [name of the customer]
Member methods:
void input() – to accept the data using the Scanner class
void print( ) – to print the details
void calculate( ) – to calculate the telephone bill as per the following criteria based on number of calls
Number of calls Rate per call
First 100 calls free
Above 100 calls Rs. 2.50
void main ( ) – to create an object of the class and invoke the functions of the class
class ___(37)____
int noc;
double bill;
String n;
void input( )
Scanner ob = ___(38)____ Scanner (System.in);
System.out.println(“Enter number of calls”);
noc = ____(39)____;
System.out.println(“Enter name”);
n = ob.next();
void calculate( )
if(___(40)___)
bill = 0;
else
bill = ___(41)____;
void print( )
System.out.println(“Name =”+n);
System.out.println(“Amount to be paid :”+ bill);
public static void main( )
Telephone T = new Telephone();
T.input();
_______(42)____;
T.print();
}
37. a. TELEPHONE b. Telephone c. telephone d. Object
38. a. new b. this c. class d. static
39. a. SC.nextInt( ) b. ob.next( ) c. ob.nextInt() d. ob.nextLine();
40. a. noc<100 b. noc <=100 c. noc>100 d. noc>=100
41. a. bill = 0 + (noc-1) *2.50 b. bill = 0 + (noc -100)*2.50;
c. bill = noc*2.50 d. None of these
42. a. t.calculate() b. T.calculate() c. T.calc() d. T.input()
Question
The following program segment calculates the norm of a number, norm of a number is square root of sum of squares
of all digits of the number.
Example
The norm of 68 is 10
6 X 6 + 8 X 8 = 36 + 64 = 100 Square root of 100 is 10
Fill in the blanks with appropriate java statements listed below
void norm (int n)
int d, s= __(43)__;
while (___(44)___)
d = n%10;
s = ___(45)___;
n = n/10;
System.out.println(“Norm =” + ____(46)____);
43. a. 0 b. 0.0 c. 1 d. 1.0
44. a. n<0 b. n>0 c. n<1 d. n>1
45. a. s*d+d b. s+d+d c. s*d*d d. s+d*d
46. a. Math.Sqrt(n) b. Math.sqrt(n) c. Math.Sqrt(s) d. Math.sqrt(s)
Question
Read the paragraph given below and answer the question given below
Case study
To check for a condition and execute the statements based on the conditions can be done using the decision control
statements. The two decision control statements in java are if and switch, switch is also called multiple branching
statement. An if statement within another if statement is termed as Nested if statement. Repetitive execution of a
set of statement is termed as looping. The two types of looping statements are entry controlled and exit controlled
loops. Both while and for are termed as entry-controlled loops. A for loop is used when the number of iterations is
known. A while loop is used when the set of statements are executed are executed as long as the condition is true, it
is executed when the number of iterations are not known.
47. What are the two decision control statements in java?
a. if and switch b. for and while c. if and while d. for and switch
48. An if statement within another if statement is termed as
a. Nested b. Nested while c. if-else-if d. Nested if
49. Name given for repetitive execution of a set of statements.
a. Looping b. Branching c. Ternary d. Dangling else
50. Which one of the following does not execute even once
a. for(k=1; k<=100;K++); b. for(k=10; k<1;K++);
c. for(k=1; k>=1;K++); d. for(k=10; k<=10;K++);