Ask Question
12 March, 08:34

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.

+2
Answers (1)
  1. 12 March, 10:20
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers