Question
IN C# PLEASE Drink Vending Machine Simulator Create an application that simulates a soft-drink vending machine. The application should let the user select one of
IN C# PLEASE
Drink Vending Machine Simulator Create an application that simulates a soft-drink vending machine. The application should let the user select one of the following soft drinks: Cola ($1.00 each) Root Beer ($1.00 each) Lemon Lime Soda ($1.00 each) Grape Soda ($1.50 each) Cream Soda ($1.50 each) Figure 8-22 shows an example of the applications form at run time. (The images that are displayed in the PictureBox controls are in the Images\Drink Machine folder of the Student Sample Programs.) When the application starts, the vending machine will have 20 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 indicating so. In the applications code, create a structure that has fields for the following data: Drink name Drink cost Number of drinks in machine The program should create an array of five structure objects. Each element of the array should keep data for a specific type of soft drink.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started