(python) Create a program that “makes change” for the user. The user will input two numbers, one is the amount charged and the other is the amount given. The program will determine the amount of change returned based on our currency. It should return the bills (if any) and the coins. Example: Charged $2.35 and paid with $3.00 Returned $0.65 2 quarters ($0.25) 1 dime ($0.10) 1 nickel ($0.05)
(python) Create a program that “makes change” for the user. The user will input two numbers, one is the amount charged and the other is the amount given. The program will determine the amount of change returned based on our currency. It should return the bills (if any) and the coins. Example: Charged $2.35 and paid with $3.00 Returned $0.65 2 quarters ($0.25) 1 dime ($0.10) 1 nickel ($0.05)
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
(python)
Create a program that “makes change” for the user. The user will input two numbers, one is the amount charged and the other is the amount given. The program will determine the amount of change returned based on our currency. It should return the bills (if any) and the coins.
Example:
Charged $2.35 and paid with $3.00
Returned $0.65
2 quarters ($0.25)
1 dime ($0.10)
1 nickel ($0.05)
NOTE: To make this a little easier, we will assume you never charge more than $20 and pay more than $20.
Requirements
- First task is not directly writing code. Create the Pseudo-code to solve this problem. This is a combination of code and english used to solve the problem before actually writing code. This can be used as the comments for your program.
- Include a comment to the top of the Python code. The comment must include the following:
- Your name
- Course name and project name
- Date completed
- The program accepts two numbers, both floats. These values should be stored in appropriately named variables.
- Calculate and display the amount of change that should be returned.
- Display the bills and change returned to the customer.
- Bonus: Only display the bills or change returned
- Bonus: If no change, display a message saying that.
- Bonus: If payment is less than charge, display a message informing the customer they didn’t provide enough money.
- All output should use appropriate currency format (See Example above).
- Make sure that your program contains meaningful comments.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education