Question: What would be a very simple coding solution to question 11 on page 538 in textbook Starting Out with Visual C# 4th edition, by Tony
What would be a very simple coding solution to question 11 on page 538 in textbook Starting Out with Visual C# 4th edition, by Tony Gaddis? I am looking for very basic/elementary level C# coding used for Windows Form App. Any guidance would be greatly appreciated.
Question states:
Create an application that simuluates a soft-drink vending machine. The application should let the user select one of the following soft drinks:
Cola - $1 each, Root beer $1 each, Lemon lime soda $1 each, Grape soda $1.50 each, and Cream soda $1.50 each.
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 application's 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
Get step-by-step solutions from verified subject matter experts
