Question
Write a program called vending.py that simulates a vending machine with respect to calculating change based on the amount paid. The program will accept
Write a program called vending.py that simulates a vending machine with respect to calculating change based on the amount paid. The program will accept as input the cost of the item purchased, and will prompt the user to add money until the cost is met/exceeded. It will then calculate and print the change. Assume that payments and change are given in R50, R20, R10, RS, R2, and R1 amounts. Sample 10: Enter the cost (in Rand): 21 Deposit a coin or note (in Rand): 10 Deposit a coin or note (in Rand): 20 Your change is: 1 x R5 2 x R2 NOTE: The program will calculate the minimum number of coins to give while making change.
Step by Step Solution
3.49 Rating (156 Votes )
There are 3 Steps involved in it
Step: 1
Getting the cost of the item from the user cost intinputEnter the costin Ra...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 StartedRecommended Textbook for
International Accounting
Authors: Timothy Doupnik, Hector Perera
3rd Edition
978-0078110955, 0078110955
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App