Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions