Question: Consider a cash register that uses an automated machine. For the paper money inserted, and the amount of purchase, the machine returns paper money and


Consider a cash register that uses an automated machine. For the paper money inserted, and the amount of purchase, the machine returns paper money and coins. Write a program that gets from user the following paper money inserted and the amount of purchase, and display the output as:

Purchase 3.08 Payment 10.00 Change 6.92 Dollars 6 Quarters 3 Dimes 1 Nickels 1 Pennies 2

Hint: - to get dollars and coins use : static_cast - use fixed and setprecision(2) as initial global input to cout, to be automatically used for all displays that follow; - insert: - insert: - setw() is not sticky; insert it for every new display !




Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!