Class IX Subject Computer Applications (Sample) FM
– 80
Section A (40 Marks)
Attempt all the questions from this section
Question 1
Choose the correct answers and write the correct option. [20]
(i) Wrapping up of data and methods together as one unit is termed as :
(a) Inheritance (b) Polymorphism (c) Encapsulation (d) Abstraction
(ii) The logical operator which is an unary operator:
(a) && (b) II (c) ! (d) >>
(iii) The scanner class is a ______ class.
(a) Primitive (b) Derived (c) Wrapper (d) super class
(iv) Math.pow(625, ½ )+Math.sqrt(144)
(a) 17.0 (b) 13.0 (c) 37.0 (d) 13
(v) multiple branching statement of java is:
(a) for (b) while (c) do….while (d) switch
(vi) do….while loop is an
(a) entry controlled loop (b) infinite loop (c) exit controlled loop (d) finite loop
(vii) int res=’A’; what is the value of res?
(a) A (b) 66 (c) 65 (d) 97
(viii) The style of expressing single line comment is:
(a) /* (b)// (c)\\ (d) /**
(ix) The output of Double.parseDouble(“71.25”)+0.75 is:
(a) 72 (b) 72.0 (c) 71.0 (d) 71.75
(x) Name the type of error that occurs for the following statement:
System.out.println(Math.sqrt(24-25));
(a) Syntax error (b) run time error (c) logical error (d) no error
(xi) An instance of a class is termed as:
(a) Attribute (b) Object (c) Value (d) Message
(xii) In which of the following languages, no variable can ever hold an object? A variable can
only hold a reference to an object.
(a) C++ (b) Pascal (c) Java (d) all of these
(xiii) What is the value returned by the following line in Java?
(a) 8.0 (b) 9.0 (c) 7.0 (d) 6.0
(xiv) A package contains:
(a) Tags (b) Classes (c) Data (d) Arrays
(xv) The access modifier that gives most accessibility is:
(a) private (b) public (c) protected (d) package
(xvi) Choose the odd one out:
(a) encapsulation (b) abstraction (c) portable (d) polymorphism
(xvii) Predict the output of the following
Math.pow(3,2)+Math.ceil(4.2)
(a) 15.0 (b) 14.0 (c) 13.0 (d) 12.0
(xviii) What is the output of the following code?
String x=(a>=90)? “excellent” : “best”; when a=90
(a) best (b) excellent (c) excellentbest (d) None of these
(xix) Choose the odd one out.
(a) + (b) - (c) * (d) ++
(xx) What is the output of Math.max(-17,-19)?
(a) -17 (b) -19 (c) 17 (d) 19
Question 2
Answer the following questions [20]
(i) Write java expression for |x+y|
(ii) What is compound statement? give an example.
(iii) What is switch case Statement? Give an example.
(iv) What do you mean by delay loop?
(v) What do you mean by nested loop? Give an example.
Section B (40 Marks)
Attempt any four Questions from this section.
Question 3
In Java, using the switch statement, write a menu driven program for the following : [10]
(i) 1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
(ii) A
B C
D E F
G H I J
Question 4
In Java, using the switch statement, write a menu driven program for the following: [10]
i. Write a program to accept the number and check the number is dudeney number or
not. A dudeney number if the cube of the sum of the digits is equal to the number itself.
Sample Input: 512
Sample Output : 512=(5+1+2)3 = (8)3 = 512
ii. A special number is a number in which the sum of the factorial of each digit is equal to
the number itself.
Example : 145 = 1! + 4! + 5! = 1 + 24 + 120 = 145
Write a program to accept the number and check the number is Special Number or Not.
Question 5
A showroom has offered the following occasion discounts on the purchase of items based on the
total cost of the item purchased: [10]
Total cost Discount Item
Less than or up to 1000 3% Glass
1001 to 3000 5% Crockery set
3001 to 5000 10% Study table
More than 5000 15% Books
Write a program to input the total cost of the item purchased, discount, amount to be paid after
availing discount.
Question 6
A disarium number is a number in which the sum of the digits to the power of their respective
positive is equal to the number itself. [10]
Example 135 = 11 + 32 + 53 = 135
Write a program to input the number and check the number is disarium number or not.
Question 7
In Java, using the switch statement, write a menu driven program for the following : [10]
i. Write a program to print Fibonacci numbers
1,1,2,3,5,8,13,21,34,55,89,144,………….n terms.
ii. Write a program to print the following series:
1,11,111,1111,…………… n terms.
Question 8
In the game of tossing a coin, you want to know the number of times you get ‘Head’ and ‘Tail’
respectively. you keep the record as 1(one) for getting Head and 0(zero) for Tail. Write a program to
perform the above task. Suppose you have tossed a coin for 20 times in this game. [10]