Class 9 Computer Applications (Finals 20-21)
Class 9 Computer Applications (Finals 20-21)
CLASS - IX
(Theory)
(Two Hours)
You will not be allowed to write during the first 15 minutes. This time is to be
spent in reading the question paper. The time given at the head of this Paper is the
time allowed for writing the answers.
This Paper is divided into two Sections. 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[].
SECTION A(40 Marks)
Attempt all questions
Question 1.
(a) Define abstraction. [2]
(b) Explain the purpose of using a ‘new’ keyword in a Java program. [2]
(c) What are literals? [2]
(d) Mention two types of Java Program. [2]
(e) What is fall through? [2]
Question 2.
(a) Differentiate between == and = operators. [2]
(b) Rewrite the following condition using ternary operators:
int a;
if ( x<y && y>z )
a=10;
else
a=25; [2]
(c) Rewrite the following for loop using while loop:
for(int x= 5; x<=50; x+=5)
{
System.out.print("*");
} [2]
(d) Name the functions of the Scanner class that is used to:
(i) Accept a number of long data type.
(ii) Accept a group of alphabets. [2]
(e) Which of the following are invalid identifiers and why?
(i) My Program (ii) 4$ABC (iii) RETURN (iv) Name [2]
Question 3.
(a) Predict output of the following:
(i) System.out.println(Math.pow(25,0.5)+Math.ceil(4.2) );
(ii) System.out.println(Math.round ( 14.7 ) + Math.floor ( 7.9)); [2]
(b) Write the following statement using nested if statement
if( a>b && a>c)
{
System.out.println(a);
} [2]
(h) State the difference between if-else if ladder and switch...case. [2]
(i) What is the result produced by 2 – 10*3 + 100/11? Show the steps. [2]
(j) What will be the output of the following program segment?
int a= 5, b = 2,c;
if (a>b || a ! = b)
c = ++a+--b;
System.out.print(c+ “ ”+a+ “ ”+b); [2]
Write a program to input the name and ticket amount for the customer and
calculate the discount amount and net amount to he paid. Display the output in
the following format for each customer:
[15]
Question 5.
Write a program to input an integer and check whether it is Special or not?
Special number is a number whose digits factorial when totaled is equal to the
number itself. Eg 145
Sum of the factorial of digits = 1! + 4! + 5! = 1 + 24 + 120 = 145
which is equal to the number.(Factorial of the number is the product of all the
numbers from 1 till the number itself)
Input: Enter an integer
145
Output: 145 is an Special number [15]
Question 6.
Using the switch statement, write a menu driven program to calculate the
maturity amount of a Bank Deposit.
The user is given the following options :
(i) Term Deposit
(ii) Recurring Deposit
For option (i) accept principal (P), rate of interest(r) and time period m years(n).
Calculate and output the maturity amount (A) receivable using the formula
For option (ii) accept Monthly Installment (P), rate of interest (r) and time period
in months (n). Calculate and output the maturity amount (A) receivable using the
formula
Question 7.
Write programs for the following series: [15]
(a) 1, 8, 27,64, 125 . . . n terms
(b) s= 1/2 + 2/3 + 3/4 …… 9/10
Question 8.
Write a class with name employee and basic as its data member, to find the gross
pay of an employee for the following allowances and deduction. Use meaningful
variable.
Dearness Allowance = 25% of Basic Pay.
House Rent Allowance = 15% of Basic Pay.
Provident Fund = 8.33% of Basic Pay.
Net Pay = Basic Pay + Dearness Allowance + House Rent Allowance.
Gross Pay = Net Pay – Provident Fund. [15]
Question 9.
Write a program to generate a triangle or an inverted triangle till n terms based
upon the user’s choice(using if else) of triangle to be displayed.
Example 1:
Input : Type 1 for a triangle and
Type 2,for an inverted triangle
1
Enter the number of terms
5
Output :
1
21
321
4 321
5 4321
Example 2:
Input : Type 1 for a triangle and
Type 2 for an inverted triangle
2
Enter the number of terms
6
Output :
666666
55555
4444
333
22
1 [15]