Question: Create an application that vending machine. The application should let the user select one of the following items: Cola ( $ 2 . 0 0

Create an application that vending machine. The application should let the user select one of the following items:
Cola ($2.00 each)
Root Beer ( $2.00 each)
Lemon Lime Soda ($2.00 each)
Grape Soda ($3.00 each)
Cream Soda ($3.00each)
In the applications code, create a structure that has fields for the following data: Drink name, Drink cost, and Number of drinks in the machine.
The program should create an array of five structure objects. Each array element should keep data for a specific type of soft drink.
When the application starts, the vending machine will have 50 of each type of soft drink. Each time the user selects a drink, the application should subtract 1 from the quantity of the selected drink. It should also update and display the total amount of sales. If the user selects a drink that is sold out, a message should be displayed that the drink is sold out.
Create an application that vending machine. The

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!