Question: Program should be written in the code below Write a program that will calculate the change to be given by a drink dispensing machine. All

 Program should be written in the code below Write a program
Program should be written in the code below
that will calculate the change to be given by a drink dispensing

Write a program that will calculate the change to be given by a drink dispensing machine. All items cost less than one pound and one pound (100p) is the highest value that can be inserted into the machine. The program must ask the user for the cost of the item and the amount inserted (in pence). The amount inserted must not be more than 100 and the cost of the item must not be more than than the amount inserted. The coins that can be given in change are 50p, 20p, 10p, 5p,2p and 1p. Your program must use the minimum amount of each coin to produce the change. For example, if the user enters 100 for the amount given and 42 for the cost of the item, the program will display (because the change is 58p): Note you do not have to worry about other input that isn't a number for this exercise. As long as the above function as written you will pass the test. Hint 1. Using integer division will really help in this program. I would think about it on paper first. Hint 2 Use a function to calculate the change and get it to return a list containing the number for each coin. Hint 3. Try to get the program working without worrying about invalid input or maximum amounts. Then add these in. Copy and paste the following into main.py to get started

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!