Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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... 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

International Accounting

Authors: Timothy Doupnik, Hector Perera

3rd Edition

978-0078110955, 0078110955

More Books

Students also viewed these Programming questions

Question

We are interviewing quite a few people, why should we hire you?

Answered: 1 week ago