Page 149 - CA_Blue( J )_Class10
P. 149
5. Write a program to take a number as input from the user and check whether it is divisible by 7 and 8.
6. Using a conditional statement, write a program to input a year of four digits and print whether it is a leap year or not.
[A leap year is a multiple of 400 or a multiple of 4 and not a multiple of 100.]
7. Write a program to input three numbers and print the largest and the smallest number among them.
8. In a shopping mall, during the festival season, the management decided to give the following discount on the purchase amount
of the customers:
Purchase Amount Discount%
Up to Rs. 2000 2.5%
Rs. 2001 to Rs. 4000 4%
Rs. 4001 to Rs. 7000 7%
More than Rs. 7000 10%
Write a program to input the Customer Name and Purchase Amount and calculate the discount and print the name and discounted
amount.
9. Write a program to input the name, consumer number and the number of calls made by the consumer and print the amount that
is to be paid. The criterion is given below:
No. of calls Rate/call
More than 250 calls 5/-
150 to 249 calls 4/-
75 to 149 calls 3/-
Less than 75 calls 2/-
A surcharge of 2.5% on the bill amount will be paid by the consumer. Display the output in the following pattern:
Name of consumer: ______________
Consumer Number: ______________
Number of calls: ____________
Bill amount before surcharge added: ________
Bill amount with surcharge: ____________
10. Write a program to input the amount of bill and mode of payment and print the different facilities given by each mode along with
the calculated amount to be paid. The criterion is given below:
Mode of payment Facilities
Credit Card(cc) 1.5% discount
Debit Card(dc) Rs. 10 cashback
E Wallet(ew) Rs. 20 cashback
Cash(c) No discount
11. Write a program to input the previous month's meter reading and current month's meter reading. Then, calculate the unit
consumed and the total amount to be paid on the basis of the following criterion:
Number of units Rate
First 100 units 2/- per unit
Next 150 units 3.5/- per unit
Next 400 units 5/- per unit
More than 650 units 7.5/- per unit
12. A company has announced the following scheme for its sales personals according to the following criteria:
Number of sales Commission Gift
Up to 50 products 5% on selling amount A Parker pen
51 to 75 products 7.5% on selling amount A Micro SD card
76 to 100 products 10% on selling amount A Mobile
More than 100 products 15% on selling amount A Laptop
Write a program to display the commission percentage based on the selling amount (provided by the user). Based on that
data also display the gift received by the sales personnel.
13. Using a menu driven program, calculate the following:
2
i. Volume of sphere (vs) = 4/3πr 3 ii. Volume of cylinder (vc) = πr h
2
iii. Volume of cone (vco) = πr h/3
147
Conditional Constructs in Java 147

