0% found this document useful (0 votes)
204 views

Computer - IX

The document contains a final exam for Class 9 on the subject of Computer Applications. It consists of 4 questions worth a total of 100 marks. Question 1 has 5 short answer questions on topics like Java keywords, OOP principles, class as an object factory, and operator types. Question 2 has 5 short code-based problems involving operators, if-else conditions, and functions. Question 3 has 5 problems involving loops, operators, and error correction. Question 4 evaluates mathematical expressions and outputs variable values. Section B contains 4 long-form programming questions requiring inputs, calculations, and outputs on topics like employee payroll, special numbers, temperature conversion, series generation, and prime number checks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
204 views

Computer - IX

The document contains a final exam for Class 9 on the subject of Computer Applications. It consists of 4 questions worth a total of 100 marks. Question 1 has 5 short answer questions on topics like Java keywords, OOP principles, class as an object factory, and operator types. Question 2 has 5 short code-based problems involving operators, if-else conditions, and functions. Question 3 has 5 problems involving loops, operators, and error correction. Question 4 evaluates mathematical expressions and outputs variable values. Section B contains 4 long-form programming questions requiring inputs, calculations, and outputs on topics like employee payroll, special numbers, temperature conversion, series generation, and prime number checks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

ST.

AGNES SCHOOL, KHARAGPUR – 721301


FINAL TERMINAL EXAMINATION 2020 – 21 FM: 100
CLASS IX COMPUTER APPLICATION TIME: 2 HRS
Section A [40 Marks]
Attempt all the questions
Question 1 [10]
a) What does the token ‘keyword’ refer in context of Java?
b) Name two OOP Principles? Explain them.
c) Why is a class called an object factory?
d) What are the types of casting shown by the following examples
1) char c = (char)120; 2) int x = ‘t’;
e) Give one point of difference between unary and binary operators

Question 2 [10]
a) If a= 4, b = 3; find the value of c = a++ * 6 + ++b*5 +10;
b) What are the values of x and y when the following statements are executed?
int a = 63 , b = 36;
boolean x = (a>b)?a:b;
int y = (a<b)?a:b;
c) State the output of the program snippet given below
int a = 10 , b = 12;
if(a>=10)
a++ ;
else
++b ;
System.out.println(“a = “+a + “and b = “ +b);
d) Differentiate between next() and nextLine() functions.
e) Rewrite the following using ternary operator.
if(p>5000)
d = p*5/100;
else
d = p*2/100;

Question 3 [10]

a) What will be the output of the following code


int m =2;
int n = 15;
for(int i = 1;i<5;i++);
m++;
- - n;
System.out.println(“m = “+ m);
System.out.println(“n = “+ n);
b) What will be the output of program segment
i. p=1 ii. p = 3
int a = 1, b = 2, c= 3;
switch(p)
{
case 1: a++ ;
case 2 : ++b;
break;
case 3 : c -- ;
}
System.out.println(a + “,” + b + “,” +c);
c) Rewrite the following using for loop
int i = 100;
while (i >0 )
{
System.out.println(i);
i = i – 2;
}
d) Predict the output of the following program snippet:
int i = 2 , k = 1;
while(++ i < 6)
k* = i;
System.out.println(k);

e) Correct the errors in the given program


class squareroot
{
public static void main(String args[])
{
int n = 289 , r;
r = sqrt(n);
if(n = r)
System.out.println(“Perfect Square”);
else
System.out.println(“ Not Perfect Square”);
}
}

Question 4 [10]
What values will be stored in the variables p and q after executing
a) double a= -99.51 , b = -56. 25;
double p =Math.abs(Math.floor(a));
double q = Math.sqrt(Math.abs(b));
b) double x= 5.9 , y= 6.5;
double p =(Math.min(Math.floor(x),y));
double q = (Math.max(Math.ceil(x),y));
c) int p =Math.abs(Math.min(-61 , -79));
double q = Math.cbrt(4.913);
d) int p = (Math.ceil(3.4) + Math.pow(2,3));
double q = (Math.floor(-4.7));
e) int p = Math.round(Math.pow(2.4, 2));
int q = Math.abs(Math.max(-8,-11));
Section B
Attempt Any Four
[60 Marks]
The answers in this section should consist of the Programs in either BlueJ environment or any program
environment with Java as the base .Each program should be written using to take the input from user and
Variable descriptions/Mnemonic Codes so that the logic of the program is clearly depicted. Flowcharts and
Algorithms are not required.

Question 5 [15]
A company announces revised Dearness Allowance (DA) and Special Allowances (SA) for their employees
as per the tariff given below:

Dearness Special
Basic
Allowance(DA) Allowance (SA)
Up to Rs 10,000 10% 5%
Rs 10,001 – Rs 20,000 12% 8%
Rs 20,001 – Rs 30,000 15% 10%
Rs 30,001 and above 20% 12%

Write a program to accept the name and Basic Salary (BS) of an employee.
Calculate and display gross salary.
Gross Salary = Basic +Dearness Allowance +Special Allowance
Display the information in the given format :
Name Basic DA Spl.Allowance Gross
Salary
xxxxx xxxxx xxxxx xxxxxx xxxxxxx

Question 6 [15]
A special two-digit number is such that when the sum of its digits is added to the product of its digits, the
result is equal to the original two-digit number.
Example: Consider the number 59.
Sum of digits = 5 + 9 = 14
Product of its digits = 5 x 9 = 45
Sum of the sum of digits and product of digits= 14 + 45 = 59
Write a program to accept a two-digit number. Add the sum of its digits to the product of its digits. If the
value is equal to the number input, output the message “Special 2-digit number” otherwise, output the
message “Not a Special 2-digit number”.

Question 7 [15]
Using a switch statement, write a menu driven program to convert a given temperature from Fahrenheit to
Celsius and vice versa. For an incorrect choice, an appropriate error message should be displayed.
5
C = 9 × (F – 32) and F = 1.8 × (C + 32)

Question 8 [15]
Write a menu driven program to print the following
1) 0,3,8,15……………………….upto n. Take the value of n from user.
2) To check and display whether a number input by user is a composite number or not.(A number is
said to be composite if it has one or more factors excluding one and number itself)
Question 9 [15]
Write a program in Java to find the sum of the given series:
S = 1+ (1*2) + (1*2*3) + ………………………+(1*2*3 *……….*n)
Take the value of n as input.

Question 10 [15]
A prime number is said to be ‘Twisted Prime’ , if the new number obtained after reversing the digits is also
a prime number. Write a program to accept a number and check whether the number is ‘Twisted Prime ‘ or
not.
Sample Input: 167
Sample Output: 761
167 is Twisted Prime

-------------xxxxxxx-------------

You might also like