coin change help

Status
Not open for further replies.

don.r.garcia

Prominent
Jan 30, 2018
2
0
510
1. Make sure that the values of quarters, dimes, nickels, and pennies are stored as constants in your program. These values are 25, 10, 5, and 1 respectively.
2. Greet the user with your name and what this program accomplishes.
– For example, "Welcome to Dr. Church's Coin Change Calculator"
3. Prompt the user for an amount of money in cents.
4. Compute and display the number of quarters, dimes, nickels, and pennies. Make sure that each denomination is clearly labeled.
 
Solution
I'll give you a hint: You want to deal with parsing out the coins starting with your largest amount. It's the exact same change-counting algorithm you would do in a store, given a decriminalized currency like the Dollar.

Also, keep in mind the % modulo operator. Might be useful.
D

Deleted member 217926

Guest
MERGED QUESTION
Question from don.r.garcia : "1. Make sure that the values of quarters, dimes, nickels, and pennies are stored as constants in your program. These values ar"



 

canadianvice

Distinguished
Jul 25, 2012
235
1
19,115
I'll give you a hint: You want to deal with parsing out the coins starting with your largest amount. It's the exact same change-counting algorithm you would do in a store, given a decriminalized currency like the Dollar.

Also, keep in mind the % modulo operator. Might be useful.
 
Solution
Status
Not open for further replies.