Ask Question
9 February, 22:04

Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies.

+1
Answers (1)
  1. 10 February, 01:49
    0
    a=input ("Amount in pennies")

    b=int (a)

    dollars=0

    dimes = 0

    quarters=0

    nickels=0

    pennies = 0

    dollars = int (b/100)

    b = b - dollars * 100

    quarters=int (b/25)

    b=b-quarters*25

    dimes = int (b/10)

    b = b - dimes*10

    nickels=int (b/5)

    b=b - nickels * 5

    pennies = b

    print (dollars)

    print (dimes)

    print (nickels)

    print (pennies)

    Explanation:

    The required program is in answer section. Note, the amount is entered in pennies.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers