21.2k views
0 votes
N this exercise, you are going to prompt the user for the number of cents (less than 1000). Based on their response, you will then determine the least number of coins needed to make change.

Remember, quarters are worth 25 cents, dimes are worth 10 cents, nickels are worth 5 cents, and pennies are worth 1 cent.

Sample Response:

Please enter an amount (less than 1000 cents): 436

Quarters: 17
Dimes: 1
Nickels: 0
Pennies: 1

1 Answer

3 votes
Quarters: 20
Dimes: 10
Nickles: 20
Pennies: 200
Total amount 900cents
User Vishnus
by
5.7k points