Grade 9 -Revision Sheet_ThirdTerm
Grade 9 -Revision Sheet_ThirdTerm
COMPUTER APPLICATION
(Theory)
The time given at the head of this paper is the time allowed for writing the answers.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
Question No. – 1
a) 11
b) 10
c) -2
d) -3
char ch;
int a = 'E';
a += 3;
ch = (char) a;
System.out.println(ch);
a) G
b) H
c) h
d) Error
viii. The correct statement to assign true to flag when x = 8 and y = 15 is:
a) flag = (x < 10 && y > 12) ? true : false;
b) boolean flag = (x > 10 || y > 12) ? false : true;
c) boolean flag = (x > 5 && y <= 15) ? true : false;
d) boolean flag = (x < 5 || y < 20) ? false : true;
xii. Java bytecode can run on all systems. Name the feature.
a) Robust
b) Object Oriented
c) Platform Independent
d) Multithreaded
xvi. The Assertion (A): Switch statements can only be used with integer data types in Java.
Reason (R):Switch statements are used to compare a single value against a list of possible values.
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.
xvii. int a=2780, b=10; System.out.print (a/b > a%b); System.out.println (a%1000);
a) false780
b) false2
c) true780
d) true
780
xviii. What will be the output after execution?
a) Syntax
b) Run Time
c) Logical
d) No Error
xx.
a) Encapsulation
b) Inheritance
c) Polymorphism
d) Abstraction
Question No. – 2
7. Complete the following and also mention the result stored in the variables:-
a) ___________ n='D' + 3;
b) ____________p ='Q'+ ""+'R';
8. The following must display the precise value after division. Identify &debug the code.
int a=12; int b=5; System.out.println (b/a);
10.
int y;
for(y=15; y<=17;y++)
System.out.print(y);
System.out.println(y);
SECTION B ( 60 Marks)
The answer in this section should consist of the Program in the BlueJ environment or any program environment
with Java as the base. Each program should be written using variable description/Menemonic Codes such
that the logic of the program is clearly depicted. Flow Charts and Algorithms are not required.
Question No. – 3
An employee wants to deposit a certain amount of money under ‘Term Deposit’ scheme in a bank. The bank has
provided the tariff of the scheme, which is given below:
No. of Days Rate of Interest No. Of Days Rate of Interest
Write a program to calculate and display the maturity amount taking the sum and number of days as input. [15]
Question No. – 4
Write a program to accept a number and check whether it is Niven number or not. A number is said to be Niven
when it is divisible by the sum of its digits.
Sample Input: 126
Sum of digits=1+2+6=9 and 126 is divisible by 9 [15]
Question No. – 6
Write a program to print the sum of negative numbers, sum of positive even numbers and sum of positive odd
numbers from a list of numbers (N) entered by the user. The list terminates when the user enters a zero. [15]
Question No. – 7
[15]
Question No. – 8
Write a program to find the sum of the given two series. The sum should be calculated and printed separately.
i) x1+x2+x3+x4………xn
ii)
[15]
*******************