Reference no: EM132101058
PLEASE USE PYTHON SPYDER
Your program must meet the following specifications:
1. At program start, assume a stock of 10 nickels, 10 dimes, 10 quarters, and 10 pennies.
2. Repeatedly prompt the user for a price in the form xx.xx, where x denotes a digit, or to enter ‘q' to quit. 3. When a price is entered: a. If the price entered is negative, print an error message and start over requesting either a new price or to quit (indicated by entering a ‘q').
b. Prompt for the number of dollars in payment. If the payment is insufficient, print an error message and reprompt for payment.
c. Next determine the coins to be dispensed as change. This calculation will depend on the amount to be dispensed and also on the number of coins left in the stock. For example, the least number of coins needed to make change of $1.30 is 6: 5 quarters and 1 nickel. But if there are only 3 quarters, 3 dimes, and 10 nickels left in the stock, then the least number is 11: 3 quarters, 3 dimes, and 5 nickels.
d. Print the numbers of the coins to be dispensed as change and their denominations. (Omit a denomination if no coins of that denomination will be dispensed.)
e. In case exact payment is made, print a message such as "No change."
f. If the change cannot be made up with the coins remaining, print an error message and halt the program 4. Just before quitting, print the total amount (the number of dollars and number of cents) left in the stock.