Question: In python, Implement a program that directs a cashier how to give change. The program has two inputs: the amount due and the amount received
In python,
Implement a program that directs a cashier how to give change. The program has two inputs: the amount due and the amount received from the customer. Display the dollars, quarters, dimes, nickels, and pennies that the customer should receive in return. In order to avoid roundoff errors, the program user should supply both amounts in pennies, for example 526 instead of 5.26.
Enter the amount due in pennies: 828 Enter the amount received from the customer in pennies: 1000
Give the following change to the customer: 1 dollars, 2 quarters, 2 dimes, 0 nickels, and 2 pennies.
Enter the amount due in pennies: 456 Enter the amount received from the customer in pennies: 2000
Give the following change to the customer: 15 dollars, 1 quarters, 1 dimes, 1 nickels, and 4 pennies.
Enter the amount due in pennies: 401 Enter the amount received from the customer in pennies: 500
Give the following change to the customer: 0 dollars, 3 quarters, 2 dimes, 0 nickels, and 4 pennies.
For this assignment you may need to use tools available to you such as //(integer division) or %(remainder)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
