KEMBAR78
9 Computer Applications | PDF
0% found this document useful (0 votes)
99 views5 pages

9 Computer Applications

The document contains 10 questions in Section A testing concepts of OOPs, loops, functions, arrays etc. and 4 questions in Section B requiring programs on series calculation, special number checking, pattern printing, function overloading, menu driven programs on number checking and calculations. Main focus is on testing basic Java concepts and programming skills.

Uploaded by

Deepram Abhi
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)
99 views5 pages

9 Computer Applications

The document contains 10 questions in Section A testing concepts of OOPs, loops, functions, arrays etc. and 4 questions in Section B requiring programs on series calculation, special number checking, pattern printing, function overloading, menu driven programs on number checking and calculations. Main focus is on testing basic Java concepts and programming skills.

Uploaded by

Deepram Abhi
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/ 5

GARDEN HIGH SCHOOL

CLASS IX

Annual Examination, 2022–23

Computer Applications
Time: 2 hours Full Marks: 100

This Question Paper has five printed pages.


Answers must be written in the script/s provided. You will not be allowed to write for the
first 15 minutes. This time must be spent in reading the Question Paper.
The time given at the head of this Paper is the time allowed for writing answers.

This Paper is divided into two sections.


Answer all the questions of Section A and any four of Section B.
Maximum marks for a question or parts of a question are given in brackets [ ].

SECTION A (40 marks)


Answer all the questions.

Question No 1
Choose the correct options: [10 × 1 = 10]
(a) The ability of an object to take on many forms is known as
(i) polymorphism. (iii) inheritance.
(ii) encapsulation. (iv) abstraction.

(b) The function prototype of a function disp() which accepts two integer arguments and
returns 1 or 0 is:
(i) void disp(int a, int b) (iii) int disp(a, b)
(ii) void disp(int a, b) (iv) int disp(int a, int b)

(c) Which among the following keywords is used to allocate memory space for an object?
(i) void (ii) new (iii) extends (iv) this

(d) Which among the following is a keyword but not a literal?


(i) for (ii) true (iii) null (iv) false

(e) Identify the valid octal literal from the following:


(i) 0178 (ii) 675 (iii) 0675 (iv) 0X675

(f) If a is of the type int and b is of the type float, what would be the resultant data type
of a + b?
(i) int (ii) float (iii) double (iv) short
(2)

(g) Which among the following is the correct statement for creating an object named book
of the class Library?
(i) book = new Library(); (iii) Library book = new book();
(ii) Library book = new Library; (iv) Library book = new Library();

(h) Choose the odd one:


(i) nextInt() (iii) nextString()
(ii) nextDouble() (iv) next()

(i) What value will Math.sqrt(Math.ceil(8.1)) return?


(i) 9.0 (ii) 9 (iii) 3.0 (iv) 3

(j) Which of these jump statements can skip processing remainder of the code in its body
for a particular iteration?
(i) break (ii) continue (iii) return (iv) exit

Question No 2
(a) Evaluate the following expression: [2]
int a = 12, b = 13, c = 11;
b = b++ + ++a * 2 * c– –;

(b) Write the Java expression for the following: [2]


x = (a + b)n ÷ (√3 + |b|)

(c) Read the following code and answer the questions: [4]
class Academic
{
int x, y;
public void access()
{
int a, b;
Academic student = new Academic();
System.out.println(“Object created”);
}

(i) What is the name of the object?


(ii) Name the instance variables.
(iii) Name the local variables.
(iv) Name the access specifier.

(d) What is the significance of the return statement in Java? [2]


(3)

Question No 3

(a) Find the output of the following: [3]


(i) int x, y;
for(x=1; x<=2; x++)
{
for (y=1; y<=4; y++)
{
if(y==3)
continue;
System.out.println(x + “\t” + y);
}
System.out.println(“x=” +x);
}

(ii) int n = 1234, d, c = 0; double s = 0.0; [3]


while(n!=0)
{
d=n%10;
s = s + d * Math.pow(10, c++);
n = n/10;
}
System.out.println(s);

(b) Convert the following to a do while loop: [2]


int x, c;
for(x=10, c = 20; c > 10; c = c – 2)
x++;

(c) Rewrite the following in terms of switch case: [2]


int code;
code=sc.nextInt();
if(code==1)
System.out.print(“Accountant”);
elseif(code==5 || code==6)
System.out.print(“Grade 4”);
elseif(code==3)
System.out.print(“Financial Advisor”);
(4)

Question No 4
(a) Differentiate between: [2 + 2 = 4]
(i) actual parameter and formal parameter
(ii) break and continue when used in a loop
(b) Write the output of the following: [3]
int sum = 23;
for(int i=2; i<=5; i++)
{
for(int j=7; j<=9; j++)
{
sum=sum+(i*j);
}
}
System.out.println(“sum= “+sum);
(c) public class Myclass [3]
{
Import java.util.Scanner;
void func()
{
Int a;
A = sc.nextInt();
Scanner sc = new Scanner(System.in);
}
System.out.println(a);
}
Rewrite the above program after removing the errors in the code, if any.

SECTION B (60 marks)


Answer any four questions.

Answers should consist of programs in either Blue J environment or any program


environment with Java as the base.
Variable Descriptions/Mnemonic Codes should be used to write each program so
that the logic of the program is clearly demonstrated.
Flow charts and algorithms are not required.
Question No 5
Write a menu-driven program to print the sum of the following series as per the user’s
choice: [15]
(a) S = 1*4 + 2*5 + 3*6 + ……+ 10*13

x2 x4 x6 x12
(b) S = + + + ....... +
2! 4! 6! 12!
(5)

Question No 6
Write a program to input an integer. Check and print whether it is a special number or not.
(A number is said to be special if the sum of the factorial of the digits of the number is equal
to the original number. Eg. 145 because 1! + 4! + 5! = 145) [15]

Question No 7
Write a menu-driven program to print the following patterns as per the user’s choice: [15]
(a) 12345 (b) 5
2345 44
345 333
45 2222
5 11111

Question No 8
Write a program to overload the function display() as follows: [15]
(a) void display() – Generate and display the first 10 terms of the Fibonacci series
0,1,1,2,3,5……
(b) void display(int n) – Input a number and print the sum of the digits and the product
of the digits of the number.

Question No 9
Write a menu-driven program to perform the following tasks as per the user’s choice: [15]
(a) Input a number and check whether it is a three-digit number or not. If it is a three-digit
number then print the largest digit in the number.
Sample input: 467
Sample output: 7
(b) Print the sum of all the even numbers between 200 and 300 (both inclusive).

Question No 10
Define a class Hotel with the following description: [15]
Data members: Rno, name, tariff, days, famount
Member functions:
(a) void checkin() – to input the room number, name, tariff and number of days
(b) void calculate() – to calculate the amount to be paid as number of days x tariff
If the amount is more than ₹10000 then a discount of 3% is given
on the amount, otherwise a discount of 1.5% is given.
(c) void checkout() – to display the room number, name and the final amount to be paid
Write a main() method to create an object of the class and call the above methods.

You might also like