LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 02-08-2016, 07:12 AM   #1
chilla101
LQ Newbie
 
Registered: Oct 2015
Posts: 7

Rep: Reputation: Disabled
Exclamation Need C++ programmer help building simple Vending Machine program


Can someone with C++ exprience build a very basic vending Machine program that has comments on the important functions and data is taken from a seperate text file.

Below are the requirements basically.
(TEXT FILE)
**************************************
Name Cost Number
Cola $0.75 20
Lemon Lime $0.75 20
Root Beer $0.75 20
Grape Soda $0.80 20
Cream Soda $0.80 20


************************************

Write a program that simulates a soft drink machine. The program should use a struct that stores
the following data:
Drink Name
Drink Cost
Number of Drinks in Machine
The program should create an array of five elements of type struct. The elements should be
initialized with the values from the file “drinkMachine.txt”.
Each time the program runs, it should enter a loop that performs the following steps:
1. A list of drinks is displayed on the screen.
2. The user should be allowed to quit the program or pick a drink.
If the user selects a drink, she will next enter the amount of money that is to be inserted into the
drink machine.
The program should display the amount of change that would be returned and subtract one from
the number of that drink left in the machine. If the user selects a drink that has sold out, a
message should be displayed. The loop then repeats. When the user choses to quit the program it
should display to the screen the total amount of money the machine earned.
Input validation: When the user enters an amount of money, do not accept negative values, or
values greater than $1.00.

*****************************************
 
Old 02-08-2016, 07:17 AM   #2
NGIB
Member
 
Registered: Sep 2013
Location: Sumter SC, USA
Distribution: MX, Lubuntu
Posts: 449

Rep: Reputation: Disabled
Reported duplicate
 
  


Closed Thread

Tags
c++, java, programming, python



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmer's distro for old machine turboscrew Linux - Distributions 37 07-25-2014 09:18 PM
LXer: Linux Ice maker and vending machine, Cool! LXer Syndicated Linux News 0 05-11-2010 05:10 PM
Simple? shell questions from a Perl programmer tspang Programming 4 05-22-2009 01:56 PM
Programmer needed for simple game. JasonByers Programming 2 04-06-2007 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration