Skip to content

STGCodeChallengesOrg/Set-01-Challenge-02

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Challenge02

Cash Register

Write a change machine that, given a U.S. currency value, determines the FEWEST number of bills and coins to return for change, listing out the exact change. Assume $1, $5, $10, $20, $50, $100 bills and penny, nickel, dime, quarter coins for the denominations.

Here are some examples: 5.27 -> 1 $5 bill, 1 quarter, 2 pennies 10 -> 1 $10 bill 30 -> 1 $20 bill, 1 $10 bill