Change Maker Lab

Objectives

Create a program that calculates change after a purpose. This will be a sequential algorithm, which is one of the simplest programming patterns. Your solution requires no branching or looping. Simply write a series of statements that will execute in order.

Discussion

The program should ask for a purchase price and the amount of cash tendered. It should then determine how many of the following denomininations should be returned:

penny
$0.01
nickel
$0.05
dime
$0.10
quarter
$0.25
dollar
$1.00
five
$5.00
ten
$10.00
twenty
$20.00

Sample Run

Price of the item:
21.37
Cash tendered:
50.00
Change: 28.63
Change Left: 2863
twenties: 1
tens: 0
fives: 1
ones: 3
quarters: 2
dimes: 1
nickles: 0
pennies: 3
    

Notes

This program is easier if you consider the following ideas: