Question: It is for Python3. Drink Machine Simulator Write a program that simulates and manages a soft drink machine. Information on each drink type should be

It is for Python3.  It is for Python3. Drink Machine Simulator Write a program that

Drink Machine Simulator Write a program that simulates and manages a soft drink machine. Information on each drink type should be stored in a text file named machinelnfo.txt that has the following data for drink name, the drink price, and the number of drinks of that type currently in the machine. Liquid Name Price Quantity in Machine Cola 1.00 15 si Soda 1.00 15 e. Soda 1.00 15 Dr.Pepper Soda 1.00 15 Bottled Water 1.50 15 the content of the file and add them accordingly to the following three lists liquidNamel price, and quantityD Functions: displayMenu0 which displays a menu of drink names and prices purchaseDrink0 which handles a sale inputMoney0, which is called by purchaseDrink0 to accept, validate, and return (to purchaseDrink) the amount of money input dailyReporto, which is called at the end of the program to report how many of each drink type remain in the machine at the end of the day and how much money was collected The program should loop and call the displayMenu function and allows the patron to either pick a drink or quit the program. If the patron selects a drink, the purchaseDrink) function is called to handle the actual sale. This function should be passed the patron's drink choice. Here is what the purchaseDrink0) function should do Call the inputMoney() function, passing it the patron's drink choice. If the patron no longer wishes to make the purchase, return all input money If the machine is out of the requested soda, display an appropriate "sold out message and return all input money machine has the soda and enough money was entered.complete the sale by updating the quantity on hand and money collected information, calculating any change due to be returned to the patron, and delivering the soda. This last action can be simulated by printing an appropriate There is your beverage message. Input Validation: Your program should only accept valid menu choices Do not deliver a beverage if the money inserted is less than the price of the selected drink. machinelnfo.txt should be updated with the last sales and report accordingly

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!