Class IX sample
Class IX sample
– 80
Question 1
Choose the correct answers and write the correct option. [20]
Question 2
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]
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]
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]
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]