Question: Write a program that stimulates a soft drink machine. The program the following data: Drink Name Drink Cost Quantity of drinks This program should be

Write a program that stimulates a soft drink machine. The program the following data: Drink Name Drink Cost Quantity of drinks This program should be initialized with the following data: Drink Name Cost (cents) Quantity Cola 1.50 10 Root Beer 1.50 10 Lemon-Lime 1.50 10 Strawberry 1.50 10 Mountain Dew 1.50 10 Mirinda Orange 1.50 10 Pepsi 1.50 10 Lemon Tea 2.00 10 Grape Soda 2.00 10 Ice Cream Soda 2.00 10 Milo 2.00 10 Apple Juice 2.50 10 Orange Juice 2.50 10 Guava Juice 2.50 10 . Each time the program runs, it should enter a loop that performs the following steps: A list of drinks and the price for each drink are displayed on the screen. The user should be allowed to either cancel selecting a drink or picking a drink. If the user selects a drink, he or she will next enter the amount of money that is to be inserted into the drink machine. The program should display the amount of change that would be returned and subtract one from the number of that drink left in the machine. If the user selects a drink that has sold out, a message should be displayed. The loop then repeats. This soft drink machine does not accept any negative values of values greater than 3.00 when the user enters the amount of money. Whenever the vendor restocks the drinks in the soft drink machine, the vendor will quit the program and it should display the total amount of money the machine earned. The machine will also display the quantity of each drink name that has not been sold yet. Upon starting the program again, the sales amount of the machine will be reset to 0 again and will display total number of drinks available in the soft drink machine for each drink name. Each time the vendor restocks the drink, the total amount of money the machine earned, the quantity of each drink that is not sold and the quantity of each drink that is being restock will be written to an output file

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!