You are on page 1of 6

Scottish High International School

Final Term Sample Paper (2023-24)


Class IX ICSE
Subject- Computer Application

M.M. :100 Time: 2 hrs


Section A (40 Marks)
Attempt All Questions

Question 1. [20]
(i) What is the return type of a method that does not return any value?
a) int b) float c) void d) double
(ii) In object-oriented programming, the stress is given on
a) procedure b) method c) class d) data

(iii) Which of the following principle does not allow to access directly from outside the class
premises?

a). data hiding b). encapsulation c). abstraction d). All

(iv) Which type of loop is guaranteed to have the body execute at least once?
a). do-while b). while c). for d). for-each
(v) What keyword is used to end the current loop iteration and proceed execution with the next
iteration of that loop?
a). break b). continue c). end d). skip

(vi). What is the output of the following code snippet?

int i = 0;
for(i = 0 ; i < 5; i++){
}
System.out.println(i);

a). 5 b). 0 c). 4 d). compilation error

(vii). Assertion (A): Java is platform-independent due to its "Write Once, Run Anywhere" (WORA)
capability.
Reason (R): Java code is compiled into bytecode, which can run on any platform with a

compatible Java Virtual Machine (JVM).

(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation 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 true and Reason (R) is false
(d) Assertion (A) is false and Reason (R) is true
(viii). Which of the following statements is true regarding encapsulation?

(a) Encapsulation is primarily concerned with code execution speed


(b) Encapsulation allows objects to hide their implementation details
(c) Encapsulation is only applicable to primitive data types
(d) Encapsulation is achieved using the finalize method

(ix). Assertive (A): Increment and decrement operators are binary operators
Reason (R): Increment and decrement operators require only one operand

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

(x). What does the expression float a = 35 / 0 return?

a). 0 b). Run time Error c). Infinity d). Run time exception

(xi). Evaluate the following Java expression, if x=3, y=5, and z=10: ++z + y - y + z + x++

a). 24 b).30 c). 20 d).25

(xii). Which of the following for loop declaration is not valid?

a. for ( int i = 99; i >= 0; i / 9 )


b. for ( int i = 7; i <= 77; i += 7 )
c. for ( int i = 20; i >= 2; - -i )
d. for ( int i = 2; i <= 20; i = 2* i )

(xiii). Which of these access specifiers must be used for main() method?

a). private b). public c). protected d). none

(xiv). The terms object and ………. are often interchangeable.


(a) instance
(b) behaviour
(c) attribute
(d) state
(xv). What will be the output of the following Java code?

1. class increment {
2. public static void main(String args[])
3. {
4. int g = 3;
5. System.out.print(++g * 8);
6. }
7. }
a) 32
b) 33
c) 24
d) 25

(xvi). The expression which uses = = operator is known as:

(a) Assignment operator


(b) Relational operator
(c) Logical Operators
(d) Conditional
(xvii). Which of these are selection statements in Java?

(a) Break
(b) Continue
(c) for()
(d) if()
(xviii). What will be the output of the following Java code?

1. class Output
2. {
3. public static void main(String args[])
4. {
5. double x = 3.14;
6. int y = (int) Math.ceil(x);
7. System.out.print(y);
8. }
9. }

a) 3
b) 0
c) 4
d) 3.0

(xix). Which among the following is not a valid error in Java?

(a) Syntax errors


(b) Logical errors
(c) Run-time errors
(d) Technical errors

(xx). What will be the output of the following Java program?

1. class jump_statments
2. {
3. public static void main(String args[])
4. {
5. int x = 2;
6. int y = 0;
7. for ( ; y < 10; ++y)
8. {
9. if (y % x == 0)
10. continue;
11. else if (y == 8)
12. break;
13. else
14. System.out.print(y + " ");
15. }
16. }
17. }
a) 1 3 5 7
b) 2 4 6 8
c) 1 3 5 7 9
d) 1 2 3 4 5 6 7 8 9
Question 2.
(i) Define abstraction. [2]

(ii) Classify the following as primitive or non-primitive datatypes: [2]


(a) char
(b) arrays
(c) int
(d) classes

(iii) Write down the java expression for: [2]

√ a2 +b2
ab
(iv) State the difference between while and do while loop. [2]
(v) System.out.print("BEST "); [2]
System.out.println("OF LUCK");

(vi) What is the value of y after evaluating the expression given below? [2]

y+= ++y + y-- + --y; when int y=8

(vii) Which of the following is the implicit conversion: [2]


a. double x = 15.2
int y = (int) x;

b. int x =12;
long y = x;

c. int p = (double) 12;

d. int m = (int) “A”;

(viii) Write the output of the following: [2]


a. Math.floor(-4.7)
b. Math.ceil(3.4) + Math.pow(2,3)

(ix) Write the output for the following: [2]


System.out.println("Incredible" + "\n" + "world");

(x) Name the following Java operators: [2]


a. &&
b. ? :

Section B (60 Marks)


Attempt Any four Questions

Question 3. [15]
Using the switch statement write a menu driven program for the following:

(i)
1

2 3

4 5 6

7 8 9 10

11 12 13 14 15

(ii) 1+ (1+2)+ (1+2+3) + ……………………….(1+2+3+……….+n)

Question 4. [15]
A certain amount of money is invested for 3 years at the rate of 6%, 8% and 10% per annum
compounded annually. Write a program to calculate:

1. the amount after 3 years.


2. the compound interest after 3 years.

Accept certain amount of money (Principal) as an input.


Hint: A = P * (1 + (R1 / 100)) T * (1 + (R2 / 100))T * (1 + (R3 / 100))T and CI = A - P

Question 5. [15]
Write a program in Java to enter a number and check whether the number is an Armstrong number or not.
(A number is said to be Armstrong if the sum of the cubes of its digits is equal to the original number.)

Sample Input: 153

Sample Output:153 is an Armstrong Number because 13+53+33

Question 6. [15]
Using a switch case statement, write a menu driven program to convert a given temperature from
Fahrenheit to Celsius and vice-versa. For an incorrect choice, an appropriate message should be
displayed.
Hint: c = 5/9*(f-32) and f=1.8*c+32.

Question 7. [15]
Write a program to display all the 'Buzz Numbers' between p and q (where p<q). A 'Buzz Number' is the
number which ends with 7 or is divisible by 7.
Question 8. [15]
Write a class with the name Area using function overloading that computes the area of a square, a rectangle
and a circle.

Formula:

Area of a square = s * s

Area of a rectangle = l*b

Area of a circle = (22/7)*r*r

You might also like