Phone Bill
Source: Katrin Becker, 1998
The Acme Telephone Company has the following rate structure:
- a. Any call started on or after 6:00 PM (1800 hrs) but before 8:00 AM (0800 hrs) is discounted 50%
- b. Any call started on or after 8:00 AM (0800 hrs) but before 6:00 PM (1800 hrs) is charged full price
- c. All calls are subject to 4% sales tax.
- d. The regular rate for a call is $0.40 per minute.
- e. Any call longer than 60 minutes receives a 15% discount on its cost (after any other discount but before tax).
-
- Write an interactive program that takes the start time for a call based on a 24 hour clock, and the length of the call in minutes. The gross cost (before any discounts or tax) should be printed, followed by the net cost (after discounts are deducted and tax added).
-
- The program must be fully documented and follow appropriate style constraints. You must provide sufficient evidence that the program compiles and executes correctly.
-
- Watch out for calls that start late at night and end in the wee hours!
-
- Possible Bonus:
- 1. Have the program allow the user to enter a number of long distance calls (i.e. a list). Costs are printed for each number after it is entered.
-
- 2. Introduce a flat rate of $0.15 per minute (plus tax) for calls made within North America.