Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

13. Drink Machine Simulator Write a program that simulates a soft drink machine. The program should use a struc- ture that stores the following data:

image text in transcribed
13. Drink Machine Simulator Write a program that simulates a soft drink machine. The program should use a struc- ture that stores the following data: Drink Name Drink Cost Number of Drinks in Machine The program should create an array of five structures. The elements should be initial- ized with the following data: Drink Name Cola Root Beer Lemon-Lime Grape Soda Cream Soda Cost .75 .75 .75 .80 .80 Number in Machine 20 20 20 20 20 Each time the program runs, it should enter a loop that performs the following it the A list of drinks is displayed on the screen. The user should be allowed to either q program or pick a drink. If the user selects a drink, he or she will next enter the steps: of money that is to be inserted into the drink machine. The program should display ha y the amount of change that would be returned, and subtract one from the number o

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

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

Design TM to perform searching.write your code in c#

Answered: 1 week ago

Question

Assessment of skills and interests.

Answered: 1 week ago

Question

Psychological, financial, and career counseling.

Answered: 1 week ago