Question: Design and write a Python program that gives exact change for an item purchased with $5 or less. Use a float data type to represent

Design and write a Python program that gives exact change for an item purchased with $5 or less. Use a float data type to represent money (You may want to multiply this number by 100 so that you get an integer for your calculation, such that $5.00 represents 500 cents, $2.35 represents 235 cents, etc.). Prompt the user to enter an item cost and an amount tendered. Check to make sure that the amount tendered is sufficient to cover the cost of the item; if not, report an appropriate error message. Allow the user to enter a new problem until they wish to stop. Your program will report the amount of change given: number of dollar bills, number of quarters, number of dimes, number of nickels and number of pennies.Design and write a Python program that gives exact change for an item purchased with $5 or less. Use a float data type to represent money (You may want to multiply this number by 100 so that you get an integer for your calculation, such that $5.00 represents 500 cents, $2.35 represents 235 cents, etc.). Prompt the user to enter an item cost and an amount tendered. Check to make sure that the amount tendered is sufficient to cover the cost of the item; if not, report an appropriate error message. Allow the user to enter a new problem until they wish to stop. Your program will report the amount of change given: number of dollar bills, number of quarters, number of dimes, number of nickels and number of pennies.Design and write a Python program that gives exact change for an item purchased with $5 or less. Use a float data type to represent money (You may want to multiply this number by 100 so that you get an integer for your calculation, such that $5.00 represents 500 cents, $2.35 represents 235 cents, etc.). Prompt the user to enter an item cost and an amount tendered. Check to make sure that the amount tendered is sufficient to cover the cost of the item; if not, report an appropriate error message. Allow the user to enter a new problem until they wish to stop. Your program will report the amount of change given: number of dollar bills, number of quarters, number of dimes, number of nickels and number of pennies.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!