0% found this document useful (0 votes)
8 views2 pages

Final Test-IX

Uploaded by

souren_mallicl
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)
8 views2 pages

Final Test-IX

Uploaded by

souren_mallicl
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/ 2

ICSE (Class-IX)

Final Test
Full Marks: 100. Time: 2hrs.
SECTION A (20 MARKS) ANSWER ALL QUESTIONS
Question 1(Chose the correct alternative) 1X20
i) Which among the following is a valid float literal?
a. 12.36f b. 12.36F c. 12.36 d. Both a and b
ii) Name the characteristics of Object Oriented Programming that hides the complexity and provides a
simple interface.
a. Encapsulation b. Polymorphism c. Abstraction d. Inheritance
iii) An object is represented by two attributes, out of which one is characteristics and the other one is_____.
a. Behaviour b. Situation c. Abstraction d. Encapsulation
iv) Which among the following is used to represent single-line comment?
a. // b. /* c. \\ d. <!—
v) Which among the following represents a syntax error?
a. Dividing an integer by zero. b. Accessing an element that is out of bounds of an array.
c. Trying to store a value which is incompatible to a certain data-type. d. Missing semicolon
vi) Which among the following Scanner methods allows us to input a number with a decimal point?
a. nextInt() b. nextFloat() c. nextDecimal() d. nextPoint()
vii) Which among the following is not a logical operator?
a. && b. || c. ! d. <=
viii) Name the process that converts source code to bytecode.
a. Interpretation b. Compilation c. All of these d. None of these
ix) A Virtual Processor that is implemented in software and runs using the capabilities provided by your
operating system and computer hardware.
a. Byte Code b. Compiler c. Interpreter d. Java Virtual Machine(JVM)
x) What is the extension of the byte code in Java?
a. .java b. .class c. Both a and b d. None of these
xi) Which among the following is a valid object name?
a. obj1 b. 1obj c. Obj 1 d. Obj#1
xii) Which among the following is not a Token?
a. Keywords b. Literals c. Identifiers d. Data Type
xiii) Which among the following is a valid method of initialising?
a. boolean f=true; b. boolean f=True; c. boolean f=’true’; d. None of these
xiv) If a is of type int and b is of type float what would be the resultant data type of a+b?
a. int b. float c. double d. short
xv) Which among the following is a relational operator?
a.+ b. > c. * d. /
xvi) Which among the following operators is used to dynamically allocate memory space for an object?
a. . (dot) b. > c. == d. new
xvii) Which among the following package is imported by default:
a. java.lang b. java.util c. Both a and b d. None of these
xviii) Which among the following function returns the absolute value of a number?
a. Math.absoulute( ) b. Math.neutral( ) c. Math.abs( ) d. Math.positive( )
xix) Which among the following gives the next mathematical integer?
a. Math.floor( ) b. Math.ceil( ) c. Math.random( ) d. All of these
xx) Which among the following constants are used in switch-case statements?
a. char b. Int c. float d. Both a and b
SECTION B (20 MARKS) ANSWER ALL QUESTIONS
Question 2 2X10

i) Which statement is optional in a switch block?What is its function?


ii) if a = 50 and b = 40 find the value of g if g=a++ - -a + b++ +(b/2)
iii) Give the output of the following for loop :
for(i=100;i>=0;i=i/10)
System.out.printlnl(i);
System.out.println("program over');
iv) Write the java expression for the following:
v) What is the difference between / and % operators?
vi) Name any two types of Java program.
vii) What is entry controlled and exit controlled loop?
viii) Name two jump statements and their use.
ix) Write any four characteristics of OOP.
x) Give the output of the following expressions.
i. If x = -9.99, calculate Math.abs(x);
ii. If x = 9.0, calculate Math.sqrt(x);

SECTION C (60 MARKS) ANSWER ANY FOUR QUESTIONS


Question 3 (Proper documentation and variable glossary is must) 4X15

i) Write a program to calculate the charge of a transport company according to the following criteria:
Weight Rate
Upto first 100 Kg Rs. 10/Km
For the next 50 Kg Rs. 7/Km
Above 150 Kg Rs. 5/km
Display the details in the following format:
Weight Kilometer travelled Total cost
_______ _____________ _________

ii) Write a program to input a number and check whether it is a prime number or not. (A prime number is
one which has two factors 1 and the number itself).

iii) Write a program to print the following two patterns:

iv) Write a program to input the radius of a circle, length and breadth of a rectangle, side of a square and a
choice. lf choice is 1 calculate and print the area of a circle (3.14*radius*radius), if choice is 2 calculate
and print the area of a square (side*side), if choice is 3 calculate and print the area of a
rectangle(length*breadth).
v) Write a program in java to print details of an employee for the following specification:

Gross Salary = (Basic Salary + DA + TA + HRA) – PF


Display the following data in given format:
EMPLOYEE NAME GROSS SALARY PF
______________ ______________ ______

vi) Write a program in java to accept a number from the user and print its last digit in words.
Example: Enter – 267 Output – Seven
-------------------------------------------------------END-----------------------------------------------------

You might also like