Professional Documents
Culture Documents
1. Write a program to determine how much to tip the waiter in a fine restaurant. The tip should
be 13 percent of the bill, with a minimum of $5.
2. A computer store sells compact discs at 50 cents each for small orders or at 30 cents for
orders of 25 compact disks or more. Write a program that requests the number of compact
discs ordered and displays the total cost.
3. A copying center charges 3 cents per copy for the first 100 copies, 5 cents per copy for the
next 200 copies and 7 cents per copy for next additional copy. Write a program that requests
the number of copies as input and displays the total cost.
4. Write a program to determine the cost of an automobile insurance premium, based on
driver's age and the number of accidents that the driver has had.
The basic insurance charge is $500. There is a surcharge of $100 if the driver is under 25
and an additional surcharge for accidents:
No. of accidents
1
2
3
4
5
6 or more
5.
6.
Accidents
surcharge
50
125
225
375
575
No insurance
Seaview Chalet provides three types of room for accommodation. The table below shows room rate for
each type of room. Write a program to calculate and print a bill that a guest has to pay if he/she rent a
room for a number of days. If the guest check in during the weekdays, 10% discount will be given.
(Notes: Assumed Friday and Saturday are the weekends)
Room Type
Super Deluxe
RM300
Deluxe
RM220
Standard
RM180
Write a switch statement that assigns to the variable lumens the expected brightness of a standard
light bulb whose wattage has been stored in watts. Use the table below :
Watts
15
125
25
215
40
500
60
880
75
1000
100
1675
sells
shirts
that retail
for $12.
given