Allenton Water Department wants a program that calculates a customers monthly water bill. The clerk will enter
Question:
Allenton Water Department wants a program that calculates a customer’s monthly water bill. The clerk will enter the current and previous meter readings. The program should calculate and display the number of gallons of water used and the total charge for the water. The charge for water is $7 per 1,000 gallons. However, there is a minimum charge of $16.67. (In other words, every customer must pay at least $16.67.)
a. Create an IPO chart for the problem, and then desk-check the algorithm twice. For the first desk-check, use 16000 and 13000 as the current and previous meter readings, respectively. For the second desk-check, use 3675 and 1650.
b. List the input, processing, and output items, as well as the algorithm, in a chart similar to the one shown earlier in Figure 5-27. Then code the algorithm into a program.
c. Desk-check the program using the same data used to desk-check the algorithm.
d. If necessary, create a new project named Intermediate13 Project, and save it in the Cpp8\Chap05 folder. Enter your C++ instructions into a source file named Intermediate13.cpp. Also enter appropriate comments and any additional instructions required by the compiler. Display the total charge in fixed-point notation with two decimal places. Test the program using the same data used to desk-check the program.
Step by Step Answer:
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell