Need C++ programmer help building simple Vending Machine program
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Exactly. This is homework, and you basically have two choices: either, learn how to do this stuff (especially when "spoon-fed" the requirements as this instructor has done), or, pick a different major. Now.
@OP you've made things gallactically (sp) worse here in my humble opinion.
I saw the reports of duplicates and then look at your posting history and it seems that you have worked somewhat on this and have created several threads about this.
Understand that if you posted a single thread, said "I would like to ask for some assistance with my homework", posted your efforts and asked some specific questions as to how to resolve things; then you'd be much better off.
Instead I see a quagmire of several threads. I hesitate to offer any technical help whatsoever because I'd rather not spend 20-30 minutes trying to figure out if you've put in any real effort, if you've copied something else and have butchered the code, or to determine at what state you are in with this project.
Best solution I can recommend is that you mark all those threads as Solved. Create one new thread detailing what you've done and exactly where you're stuck, admit that it is homework, realize that people will help you to a degree with it, and then be patient and let members review the information you've posted and use that sole thread to work through your assignment.
Bear in mind that you will need to be the primary person to complete your assignment. There are no promises here, except that if you persist in acting against LQ rules, the moderators will eventually remove you from the forum.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.