I need help with the following Python 3 question: Write a Python program that, for a given amount of money (given as a float), breaks the amount down into different denominations. Report the output in...


I need help with the following Python 3 question:


Write a Python program that, for a given amount of money (given as a float), breaks the amount down into different denominations. Report the output in terms of:




● Number of dollars
● Number of quarters
● Number of dimes
● Number of nickels
● Number of pennies




Your program must report these outputs using the minimum number of coins/dollars possible.  This is called an optimization problem. We could turn the amount into all pennies, and that’s technically correct -- it converts an amount into a breakdown of denominations. But, it’s not what we’re going for here; instead, we want a correct solution, with the fewest coins/dollars we can possibly come up with.


The input from the user is a float. If they enter more than two digits after the decimal place, round to the closest 100th


Things to note:


● Any value you use more than once is saved in a variable, not used as a literal.
● Use only one print statement for the final output, but without going over 80 column-width in your Python code.


Example Output:


Enter the change amount:
3.7812


That breaks down to:
3 dollars
3 quarters
0 dimes
0 nickels
3 pennies


>>>



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here