Question: Write a program that displays the various drinks your vending machine offers along with the option number for each drink. Beside each option include the

Write a program that displays the various drinks your vending machine offers along with the option number for each drink.Beside each option include the price (you can set the cost for the small, the costs for medium should be 2 times the cost of the small and the cost of the large should be 3 times the cost of the small). For example: 1. Tropical Iced Tea (Small $0.75, Medium $1.50, Large $2.25) Then prompt the user for their drink selection and enter their selection.Record the cost of the small drink into a variable that will be used to compute the amount due (to be used in program 4). Display a message such as You selected Tropical Iced Tea.If the user does not enter a valid option, print an error message and exit the program. To check that you have recorded the amount due properly, after the conditional statement, display the amount due for the small size of the drink selected. You must offer at least 4 drink options.

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 Programming Questions!