Write in Python on Visual Code, the money collection interface for the coffee vending machine. Your program should tell the user the price of the item and then the user will enter the amount of money that they are paying (this simulates them actually inserting cash). If the money collected is less than the price, print an appropriate message (such as: “Insufficient funds, no sale!”) and then the program should exit. If enough money is collected, determine the amount to return to the customer. If the change due is not zero, tell the user how much change they will receive. Next print a message (such as “Thank you – enjoy your coffee !”) and end the program normally. Note, your program should be able to handle all amounts of money (not just multiples of dollars but also cents such as $1.25). Also you may assume that the user is only entering a number and not the $ (though the $ could be part of your prompt).Hint: Check how to do floating point comparisons!
Write in Python on Visual Code, the money collection interface for the coffee vending machine. Your
If enough money is collected, determine the amount to return to the customer. If the change due is not zero, tell the user how much change they will receive. Next print a message (such as “Thank you – enjoy your coffee !”) and end the program normally.
Note, your program should be able to handle all amounts of money (not just multiples of dollars but also cents such as $1.25). Also you may assume that the user is only entering a number and not the $ (though the $ could be part of your prompt).Hint: Check how to do floating point comparisons!
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images