You are on page 1of 4

M.C.KEJRIWAL F.M.

100
V I D Y A P E E T H
FINAL ASSESSENT 2020-2021 Time 2 Hrs.
SUBJECT:COMPUTER APPLICATIONS
(THEORY)
CLASS : IX

Candidates are allowed an additional 15 minutes for reading the paper.


Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or part of questions are given in brackets[].

SECTION A ( 40 Marks )
Attempt all questions.

Question 1.
(a) Define abstraction [2]
(b) What is explicit type conversion? [2]
(c) What is an import statement? Give an example. [2]
(d) Write the default value of the following primitive data types: [2]
(i) double (ii) int (iii) String (iv) char
(e) Write the function and syntax of random( ) mathematical method. [2]

Question 2.
(a) What is a forward loop? Give an example. [2]
(b) Identify the following keywords in JAVA: [2]
(i) It is used to convert variable and its value into constant.
(ii) It is an operator that dynamical allocates a memory.
(c) Write the syntax of while loop. [2]
(d) What are the parameters needed to create a for loop? [2]
(e) Write one differences between Math.ceil( ) and Math.floor( ). [2]

Question 3.
(a) Write a statement in Java for: p 2+ pII [2]
(b) Analyze the given code and answer the following question: [2]
public class series
{
public static void main(String args[]) {
for (int i = 1; i <= 10; i++) {
System.out.print(i * i + " ");
}
}}

(i) How any times the code will execute?


(ii) What is the given code computing?

This question paper consists of 4 printed pages. -1- Turn Over


(c) Predict the output of the following code: [2]
switch (opn)
{
case 'a':
System.out.println("Platform Independent");
break;
case 'b':
System.out.println("Object Oriented");
case 'c':
System.out.println("Robust and Secure");
break;
default:
System.out.println("Wrong Input");
}
When (i) opn = 'b' (ii) opn = 'x'

(d) What output is generated when the given code is executed? [2]
class pattern{
public static void main(String args[])
{
int i;
for(i = -1;i<10;i++)
{
System.out.println(++i);
}
}}

(e) Rewrite the following code using while loop: [2]


int x,c;
for(x=10,c=20;c>=10;c=c-2)
{
x++;
System.out.println(x);
}

(f) Give the values stored in ‛m1’ and ‛m2’ after the execution of the given statements: [2]
(i) double m1= Math.abs(Math.max(-9.0,-95.3));
(ii) double m2= Math.sqrt(Math.floor(625.1));

(g) Give the output of the following program segment and also mention the number of [2]
times the loop is executed.
int a,b;
for(a=6;b=4; a <= 4; a=a+ 6)
{
if(a%b==0)
break;
}
System.out.println(a);

-2-
(h) Consider the following code and determine the output , if d= 10, n=3: [2]
switch(n)
{
case 1:System.out.println(++d); break;
case 3:System.out.println(++d+--d); break;
default: System.out.println("Try Again");
}

(i) Write a statement in Java statement using ternary operators to assign and print grade ‛A’ [2]
if the percentage of marks is greater than 80 otherwise print ‛B’.

(j) Name the following: [2]


(i) It is an identifiable entity with some characteristics and behavior.
(ii) It is used to translate the source program or source code into machine language
or low-level language at once.

SECTION B ( 60 Marks )
Attempt any four questions from this Section.
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 Variable descriptions/Mnemonic Codes such that the logic
of the program is clearly depicted.
Flowcharts and Algorithms are not required.
Question 4. [15]
Write a program to input the cost price(CP) and the selling price(SP) of an article.
If the selling price is more than the cost price then calculate and display actual profit(P)
and profit percent(PP) otherwise, calculate and display actual loss(L) and loss percent(LP).
If the cost price and the selling price are equal, the program displays the message
'Neither profit nor loss'.
[Profit Percent=(Profit/Cost Price)X100] and [Loss Percent=( Loss /Cost Price)X100]

Question 5. [15]
In an examination, the students have appeared for three subjects, Physics, Chemistry
and Biology. Write a program in Java to input the marks of Physics, Chemistry and
Biology and calculate the average mark obtained in the examination and finally display
the marks in rounded-off form.

Question 6. [15]
Using a switch statement, write a menu driven program to perform the following task:
(a) Generate and display the first 10 terms of the given series.

2 5 10 17 26………
(b) Find the sum of the digits of an integer that is given as input by the user.
Input : 15390
Output : Sum of the digits = 18
For an incorrect choice, an appropriate error message should be displayed.

-3-
Question 7. [15]

Write a Java program to generate and show all Kaprekar numbers less than 1000.
In number theory, a Kaprekar number for a given base is a non-negative integer,
the representation of whose square in that base can be split into two parts that add up
to the original number again.
Input : n = 45
Output : 45 is a Kaprekar number
Explanation : 452 = 2025 and 20 + 25 is 45

Input : n = 13
Output : 13 is not a Kaprekar number
Explanation : 132 = 169. Neither 16 + 9 nor 1 + 69 is equal to 13

Question 8. [15]

Write a program by using class 'Employee' to accept Basic Pay (BP) of an employee.
Calculate the allowances/deductions as given below.
Allowance / Deduction Remarks
Dearness Allowance (DA) 30% of Basic Pay
House Rent Allowance (HRA) 15% of Basic Pay
Provident Fund (PF) 12.5% of Basic Pay
Finally, find and print the Gross pay (GP) and Net pay (NP).
Gross Pay = Basic Pay + Dearness Allowance + House Rent Allowance
Net Pay = Gross Pay - Provident Fund

Question 9. [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.
Input : 167
Output : 761
167 is a 'Twisted Prime'.

**********************************************************************

-4-

You might also like