Question
In Python 3, Implement a program that directs a cashier how to give change. The program has two inputs: the amount due and the amount
In Python 3,
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started