soft drink Vending machine program
//I need help to write this program I am fairly new to C+ and I need the program to use struct. Please help me get started. I don't know where to start!!!!!
Write a program that simulates a soft drink machine. The program should use a structure that stores the following information:
Number of drinks in machine
The program should create an array of five structures. The elements should be initialized with the following data:
Drink Name Cost Number in Machine
Coke .75 30
Water .75 10
Sprite .50 50
MountainDew .80 25
MinuteMaid .80 20
Each time the program runs, it should enter a loop that does the following:
1) Display a list of drinks on the screen
2) Allow the user to either quit or pick a drink
3) If the user picks a drink, he or shill will then enter the amount of money to be inserted into the machine
4) The program should then display the amount of change that would be returned and update the number of drinks still in machine. If the user has not entered enough money, the program should display how much more should be entered to complete the sale.
5) If the user selects a drink that has been sold it, a message should be displayed
This loop should continue until the user says Quit. When the user quits, it should display the total amount of money earned by that machine (based on how many drinks were bought).
The program should not accept money amounts less than 0 or greater than $1.00
Last Post: 03-18-2002, 10:25 AM
By Gordon Reichhardt in forum VB Classic
Last Post: 01-08-2002, 10:06 AM
By Avi Shatz in forum VB Classic
Last Post: 03-18-2001, 11:33 AM
By Ricardo in forum VB Classic
Last Post: 05-12-2000, 10:40 AM
Last Post: 04-14-2000, 07:39 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL