Question: Develop an algorithm in Python which will be used by a vending machine to dispense change. The cost of the item can be any amount
Develop an algorithm in Python which will be used by a vending machine to dispense change. The cost of the item can be any amount up to five dollars and we will assume that the machine only accepts 5 dollar bills and returns change using the highest form of currency first, the dollar bill, followed by quarters then dimes, then nickels, and finally pennies. So, if an item costs $ 1.65 the machine will return three one-dollar bills and one quarter and one dime. Print Insert More Money if the amount entered is less than the cost of the item selected, otherwise dispense correct change.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
