0% found this document useful (0 votes)
40 views9 pages

9th 1st Term Paper - Retest

Uploaded by

Mandadi Jyoshna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views9 pages

9th 1st Term Paper - Retest

Uploaded by

Mandadi Jyoshna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

NIRAJ PUBLIC SCHOOL

ST
1 TERM EXAMINATION –SEPTEMBER 2023-24
COMPUTER APPLICATIONS
CLASS: 9
TIME: 2 hrs. MARKS: 100

Answers to this paper must be written on the paper provided separately.


You will NOT be allowed to write during the first 15 minutes.
This time is to be spent in reading the question paper only.
Answer 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 NO 1:- [20]
Choose the correct answer and write the correct option:

(i) Wrapping up of data and methods together as one unit is termed


as ________.
(a) Abstraction
(b) Encapsulation
(c) Polymorphism
(d) Inheritance

(ii) Which of the following best defines a class?


(a) Parent of an object
(b) Instance of an object
(c) Blueprint of an object
(d) Scope of an object

(iii) ___________ is the full form of JRE.


(a) Java Runtime Editor
(b) Java Runtime Expression
(c) Java Runtime Enabler
(d) Java Runtime Environment

(iv) A java expression that contains same type of operator is known


as _____________ expression.
(a) Simple
(b) Complex
(c) Pure
(d) mixed

(v) Range of short data type in Java is _____________


(a) -128 to 127
(b) -32768 to 32767
(c) 0 to 65535
(d) -256 to 255

(vi) Write the output:

for (int i=10; i>=1; i=i-2)


{
System.out.print( i- - + “ “);
}
(a) 10 7 4 1
(b) 10 8 6 2
(c) 9 7 5 3 1
(d) 9 7 5 3

(vii) A method to accept a decimal value through a Scanner object


(a) nextInt( )
(b) next( )
(c) nextDouble( )
(d) nextLong( )

(viii) Write the output:


int p=(int) ‘D’;
int q=(int) ‘x’;
System.out.println(p+q+25);
(a) 213
(b) 203
(c) 225
(d) 215

(ix) int a=4, b=3, x;


Find the value of x = b++ *5 + a++ * --b + a;
(a) 39
(b) 32
(c) 47
(d) 52

(x) How many times the following loop is executed and what is
the output?
int i=1;
while(i<=1) {
i ++;}
System.out.println(i);
(a) Loop is executed 1 time and the output is 2
(b) Loop is executed 1 time and the output is 4
(c) Loop is executed 1 time and the output is 3
(d) Loop is executed 1 time and the output is 1

(xi) Which of the following does not represent a character literal?


(a) “a”
(b) ‘a’
(c) ‘1’
(d) ‘?’

(xii) Write the output:


for(int m=5; m<=20; m+=5)
{
if(m%3 == 0)
break;
System.out.print(m+ “ ”);
}
(a) 5 10 15 20
(b) 5 10 15
(c) 5 10
(d) 5

(xiii) The keyword which makes the variable a class variable.


(a) class
(b) final
(c) static
(d) public

(xiv) Write the output:


char m= ‘A’;
int p=15;
System.out.println(m+p);
System.out.println(“Answer: ”+ m+p);
(a) 105
Answer: 105
(b) 80
Answer: 80
(c) 80
Answer: A15
(d) 105
Answer: A15
(xv) What is byte code in Java?
(a) Code generated by a Java compiler
(b) Code generated by a Java Virtual Machine
(c) Name of Java source code file
(d) Block of code written inside a class

(xvi) In Java, …………. can only test for equality, whereas ………… can
evaluate any type of boolean expression.
(a) switch, if
(b) if, switch
(c) if, break
(d) continue, if

(xvii) What will be the output of p=8/5, if p is float


(a) 1
(b) 1.0
(c) 1.6
(d) 3.0

(xviii) The style of expressing single line comment is:


(a) //comment//
(b) \\comment
(c) /*comment*/
(d) //comment

(xix) The package that is invoked by default:


(a) java.util
(b) java.lang
(c) java.io
(d) java.System
(xx) Write the output:
System.out.println(Math.ceil(-11.51)));
System.out.println(Math.pow(4, 3)));
(a) -12.0
64
(b) -12.0
64.0
(c) -11.0
12.0
(d) -11.0
64.0

QUESTION NO 2:-

(i) Write the difference between for loop and while loop.
[2]

(ii) Write the output.


[2]
System.out.println(“Name: Aditi\n”+ “Age: 14 yrs \n”+ “Class:
IX”);
System.out.println(“\t Welcome to \” Java \”class”);

(iii) Rewrite the following using ternary operator.


[2]
if(income <=10000)
tax=0;
else
tax= 12;

(iv) Write the difference between primitive data type and composite
data type.[2]

(v) (i) Name the two types of java programs


(ii) Write the default values of boolean and String data types.
[2]

(vi) What is the difference between the prefix, postfix and infix
notations? [2]
(vii) Write Java expression for T= √ 3 x+ x 2
[2]

(viii) (a) Define Keyword.


(b) What is the significance of default statement in switch?
[2]

(ix) Rewrite the following if statement using switch-case construct.


[2]
char value;
if( value == 1)
salary=salary+20000;
else if (value == 2)
salary=salary+15000;
else
salary= salary + 10000;

(x) Rewrite the following code using do-while loop.


[2]
int p=30;
for(int i=10; i>=2; i=i-2)
{
p++;
System.out.println(p);
}
SECTION B (60 Marks)
Attempt any four questions from this Section.
Each question carries 15 marks.
The answers in this section should consist of the programs in
either Blue J environment or any program environment with Java as
the base.

QUESTION NO 3:- [15]

Write a program to accept the name of a customer, weight of the parcel


and calculate the bill amount to be paid based on the given conditions.
Display the details of the customer in the following manner:
Navata Transport Company
Name of the customer: ______________
Weight of the parcel: _________________
Bill amount to be paid: _______________

Weight of the parcel Charge


Up to 10kg Rs. 20 per kg
For the next 20 kg Rs.10 per kg
For the next 20 kg Rs.8 per kg
>50 kgs Rs.5 per kg

QUESTION NO 4:- [15]

Write a menu driven program to perform the following tasks by using


switch case statement:
i) To display the series:
1, 11, 111, 1111, ………………………8th term

ii) To display the series:


2, 9, 28, 65, 126, ………………………nth term (value of n is to be
input by the user)

iii) To find and display the sum of the series:


S= x2 + x5 + x8 +x11 ………………. xn (value of n and x are to be
input by the user)

QUESTION NO 5:- [15]

Write a menu driven program to perform the following based on the user’s
choice.

(i) accept a number and check if it is an Armstrong number or not.


Armstrong number: A number is said to be an Armstrong, if
sum of the cubes of digits is equal to accepted number.
Example: 153
33 + 53 + 13 = 27 + 125 + 1 = 153

(ii) accept a number and check if it is a Prime number or not.

Prime number: A number is a Prime number which has only 2


factors 1 and itself
Example: 5, 7, 13, etc.

QUESTION NO 6:- [15]

Write a java program to input the salary and experience of an employee


and compute the House Rent Allowance (HRA) depending on the criteria
given below.

SALARY EXPERIENCE(in HRA


years)
<10000 <5 4%of salary
5-10 6% of salary
>10 8% of salary
10000-15000 <5 4%of salary
5-10 7% of salary
>10 10% of salary
>=15000 <5 7% of salary
5-10 10%of salary
>10 12% of salary

QUESTION NO 7:- [15]

(i) Write a program to Accept 2 numbers and find the HCF and LCM of the
numbers.
Example: 16, 24
Factors of 16 = 1, 2, 4, 8, 16
Factors of 24 = 1, 2, 3, 4, 6, 8, 12, 24
Common Factors = 1, 2, 4, 8
HCF = 8
Product of 2 numbers
( Hint: LCM = HCF
)

(ii) Write a program to accept a number and check if it is a


Palindrome number or not.

Palindrome number:- A number is said to be a Palindrome


number if the reverse of the number is equal to the accepted
number.
Example:- 121
Reverse of the number = 121

QUESTION NO 8:- [15]

Write a menu driven program to calculate the area of parallelogram, a


rhombus and a trapezium based on the choice input by the user.

Formula: Area of a parallelogram= base*height


1
Area of rhombus = 2 * d1 * d2 (Where d1 and d2 are the
diagonals)
1
Area of trapezium = 2 * (a+b) *h (Where a and b are the
parallel sides,
h is the perpendicular
distance
between the parallel sides)

You might also like