Ask 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 coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies.

+5
Answers (1)
  1. 4 April, 00:12
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers