Menu

Need Help Following Python 3 Question Write Python Program Given Amount Money Given Float Q43906091

I need help with the following Python 3 question:

Write a Python program that, for a given amount of money (givenas 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 numberof coins/dollars possible. This is called an optimization problem.We could turn the amount into all pennies, and that’s technicallycorrect — it converts an amount into a breakdown of denominations.But, it’s not what we’re going for here; instead, we want a correctsolution, with the fewest coins/dollars we can possibly come upwith. The input from the user is a float. If they enter more thantwo digits after the decimal place, round to the closest 100th.

Test case #1: $4.50 4 dollars, 2 quarters, 0 dimes, 0 nickels, 0pennies

Test case #2: $.2879 0 dollars, 1 quarter, 0 dimes, 0 nickels, 4pennies

Other notes:

Any value used more than once is saved in a variable, not usedas a literal

Use only one print statement for the final output, but withoutgoing over 80 column-width in the Python code.

Example Output:

Enter the change amount

3.7812

The breaks down to:

3 dollars

3 quarters

0 dimes

0 nickels

3 pennies

Expert Answer


Answer to I need help with the following Python 3 question: Write a Python program that, for a given amount of money (given as a f…

OR