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 $ each
Root Beer $ each
Lemon Lime Soda $ each
Grape Soda $ each
Cream Soda $each
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 of each type of soft drink. Each time the user selects a drink, the application should subtract 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
