Reference no: EM132356423
Exercise: Making change
Topics - Expressions, variables, input, %, //, Turtle
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.
Sample runs:
Welcome to the change maker!
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.
When you have completed this program, save a copy and modify the copy to write the output to Turtle.