SEVENTH DAY ADVENTIST HIGH SCHOOL
II TERM EXAMINATION
STD : IX D,E COMPUTER APPLICATIONS MARKS: 100
SECTION ‘A’ (40 MARKS)
(Attempt all questions)
Question 1
(a) An object is an _____ of a class [1]
(b) Exposing only essential features while hiding unnecessary details is _____. [1]
(c) What is polymorphism? [2]
(d) What do you understand by object factory? [2]
(e) What are methods? How are these related to object? [2]
(f) Objects interact with one another through _______. [1]
(g) A _______ is a set of objects that have a common structure and behaviour [1]
Question 2
(a) What is byte code? [2]
(b) What are the two types of java programs? [2]
(c) What is JVM? [2]
(d) What do you know about bluej? [2]
(e) Distinguish between unary ,binary and ternary operators. [2]
Question 3
(a) A= 8+5/2 results in _______ [1]
(b) All special characters are allowed in Java identifiers. True or False [1]
(c) What is meant by token? Name the tokens available in Java [2]
(d) Which of the following are valid identifiers and why/why not? [2]
i) _CHK ii) 20_to_50 iii) Break iv) Test.file
(e) What will be the output of the following? [2]
System.out.prinltn(2+3+”hello”);
System.out.println(“hello”+2+3);
(f) Write advantages of using methods in programs. [2]
Question 4
(a) What is the use of keyword void? [2]
(b) What is the role of a return statement in a method? [2]
(c) What will be result of following expression if i) mark=70 ii) mark=40? [2]
mark > 50 ? ”PASS” : “FAIL”
(d) Convert into Java expression [2]
ax 3 + bx 3
ut + ½ at 2
(e) Find the output of the following if m= 5 initially [2]
m+= m++ - m-- - ++m - --m;
SECTION - ’B’(60 MARKS)
(Attempt any three questions)
Question 5
Design a class student with the following description
Instance variables
String name. – to store the name of the student
int rollno. – to store the roll number
int m1,m2,m3. – to store marks in three subjects
int total. – to store the total
String grade. – to store the result
Member Functions
void input( ). – to accept name, roll number ,marks
void calculate( ). – to calculate total and grade as follows
Total. Grade
270 to 300. O
240 to 269. A
210 to 239. B
150 to 209. C
< 150. D
void display( ). – to display the result
Write a main program to create an object for the class and call the methods
Question 6
Design a class employee with the following description
Instance variables
String name. – to store the name of the employee
int empno – to store the employee number
double salary. – to store the basic salary
double pf – to store the provident fund
double pay. – to store the net pay
Member Functions
void input( ). – to accept name, employee number and salary
void calculate( ). – to calculate pf and net pay as follows
pf = 12% of salary
netpay. = salary - pf
void display( ). – to display the pay slip
Write a main program to create an object for the class and call the methods
Question 7
Design a class telephone with the following description
Instance variables
String name. – to store the name of the consumer
int phno – to store the phone number
int calls. – to store the number of calls
double charge – to store the amount to be paid
Member Functions
void input( ). – to accept name, phone number and calls count
void calculate( ). – to calculate charge as follows
Calls. Rate / call
Upto 100. Free
101 to 300. 2
301 to 500 3
Above 500. 3.50
void display( ). – to display the bill
Write a main program to create an object for the class and call the methods
Question 8
(a)Write a java program to find the volume of a sphere whose radius is 8cm ( volume = 4/3π r3 )
(b) Write a Java program to display the certificate “Awarded” to the students who got marks above 90 and for
others “Not Awarded”