Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sql All In One For Dummies 7 Books In One

Authors: Allen G Taylor ,Richard Blum

4th Edition

1394242298, 978-1394242290

More Books

Students also viewed these Databases questions

Question

What is IUPAC system? Name organic compounds using IUPAC system.

Answered: 1 week ago

Question

What happens when carbonate and hydrogen react with carbonate?

Answered: 1 week ago