A third-grade teacher at Potter Elementary School wants a program that allows a student to enter the

Question:

A third-grade teacher at Potter Elementary School wants a program that allows a student to enter the amount of money a customer owes and the amount of money the customer paid. The program should calculate and display the amount of change, as well as how many dollars, quarters, dimes, nickels, and pennies to return to the customer.

Display an appropriate message when the amount paid is less than the amount owed.

a. Create an IPO chart for the problem, and then desk-check the algorithm three times. For the first desk-check, use 75.34 and 80 as the amount owed and paid, respectively. For the second desk-check, use 39.67 and 50. For the third desk-check, use 10.55 and 9.75.

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 Advanced15 Project, and save it in the Cpp8\Chap05 folder. Enter your C++ instructions into a source file named Advanced15.cpp. Also enter appropriate comments and any additional instructions required by the compiler. Display the change in fixed-point notation with two decimal places. Display the remaining output in fixed-point notation with no decimal places. Test the program using the same data used to desk-check the program.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: