You are on page 1of 2

Ajay Chaudhary Classes

Being Brilliant:-
Computer test(Conditional statements & switch)
Max marks :-40 Time limit :- 1 hr 30 min
Question 1.
Define the terms with example:-[5]
 Fall through
 Use of break
 Use of default
Question 2..
What do you mean by scope of a conditional statement? Explain with the help of an example.[5]

Question 3.
A cloth showroom has announced the following seasonal discounts on purchase of items:[10]
Purchase Amount ( `) DISCOUNT
Mill Cloth Handloom Items
0 – 1000 ------- 5%
1001 - 2000 5% 7.5 %
2001 - 3000 7.5 % 10 %
Above 3000 10 % 15 %
Write a Java program to input the purchase amount and Item Code viz : M or m for Mill Cloth
and H or h for Handloom Items.
Calculate the discount amount. Find the net balance to be paid excluding the discount.
Print the Purchase Amount, Item Type, Discount and the net amount to be paid.

Question 4.
A hotel is giving seasonal discount on the total amount to be paid by the person staying at the
time of check out. The charges for one day stay is `850.0 per room. The discount will be given as
per the following criteria:[10]
Number of days stayed Discount on total amount
Upto 5 days 10%
> 5 days and <= 10 days 15%
> 10 days and <= 20 days 20%
More than 20 days 25%
Write a program to input name of guest, total number of days stayed in the hotel.
Calculate the total amount to be paid and discount amount. Find the net balance to be paid
excluding the discount. Print the bill including all the data.

Question 5.
Write a menu driven program in java which compute the program according to user’s choice.[10]
 If user press 1 :- the program to check whether number is composite number or not
 If user press 2 :- the program to checks whether number entered by the user is perfect or
not
 If user press 3 :- the program to display all the multiples of 4 ,less than 80.

You might also like