You are on page 1of 2

SAMPLE PAPER, CLASS – 9, COMPUTER APPLICATIONS, HALF YEARLY EXAMINATIONS – 2023

Seciton – A
(Attempt all the questions from this section)
Q.1) Tick the correct option. [10]
1. The Math class is present in ______ package.
a) java.util b) java.io c) java.lang d) None of these
2. Which of the following keyword is used to create an instance of a class?
a) instance b) static c) new d) None of these
3. Which conversation takes place when the value of an int type variable is stored in a float type variable?
a) Explicit conversion b) implicit conversion c) Both options (a) and (b) d) None of these
4. The logical operator which is also an unary operator.
a) && b) || c) ! d) None of these
5. Which off the following is not a primitive data type.
a) byte b) char c) boolean d) String
6. Which of the following reserved word is also a literal?
a) new b) static c) public d) false
7. The method that is used to accept a group of characters without any space is…
a) nextLine() b) next() c) next().charAt(0) d) None of these
8. Which type of conversion takes place when any real value is kept in an int data type variable?
a) Explicit conversion b) implicit conversion c) Both options (a) and (b) d) None of these
9. The data type short occupies…
a) 1 byte b) 2 bytes c) 4 bytes d) 8 bytes
10. Assigning a value in a variable during compile time is ….
a) Static initialization b) Dynamic initialization c) Both options (a) and (b) d) None of these

Q.2) Do as directed. [2 x 5]
1. Arrange the following operators in higher to lower order
% , ! , ? , &&

2. Write a Java expression for: m2 – 2mn + √n

3. Re-write the following using Ternary operator.


if(mark>90)
System.out.println(“A+”);
else
if(mark>70)
System.out.println(“B+”);
else
System.out.println(“C+”);

4. Find the output of the followings.


(i)
int a = 8;
a=a++ / 3 + a * – – a / a;
System.out.println(a);
(ii)
if(mark>70)
if(mark>90)
System.out.println(“A+”);
else
System.out.println(“B+”);
else
System.out.println(“C+”);

What will be the output of above code if (a) mark = 78 and (b) mark = 92

Section – B
(Answer any four questions from this section. Each question carries 15 marks.)
(Documentation is required for each program.)

Q.3) Write a program to accept a year. Check whether it is a century year, or century leap year or only a leap
year or a normal year.

Q.4) Write a program to input three unequal numbers. Display the greatest and smallest number.

Q.5) Write a program to accept the number of kilometers travelled by a passenger in a taxi and display the taxi
fare on the following basis.
Kilometer Fare
Upto 5 km Rs.100 in total
Next 10 km Rs.20 / km
Thereafter Rs.10 / km

Q.6) Write a program to input the total amount purchased by a customer and display the discount amount and
the gift on following basis.
Total purchase amount Discount Gift
Up to 2000 5% Calculator
2001 to 5000 10% School Bag
5001 to 10,000 15% Wrist Watch
Above 10,000 20% Smart Phone

Q.7) Write a menu driven program to convert a given temperature either from Fahrenheit to Celsius or vice
versa as per user’s choice. (C = 5/9*(F – 32) and F = 9/5 * C + 32)

Q.8) Write a menu driven program to display either simple interest or compound interest as per user’s choice
taking principal, rate and time as input from user. (Take ‘S’ as simple interest and ‘C’ for compound interest)
(Hint: SI = PTR/100 and CI = P (1+R/100) T – P)

You might also like