LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-08-2016, 07:14 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:16 AM   #2
NGIB
Member
 
Registered: Sep 2013
Location: Sumter SC, USA
Distribution: MX, Lubuntu
Posts: 449

Rep: Reputation: Disabled
First, don't double post.

Second, why should we do your homework?
 
Old 02-08-2016, 07:41 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
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.
 
Old 02-08-2016, 08:01 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
@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.
 
Old 02-08-2016, 08:21 AM   #5
NGIB
Member
 
Registered: Sep 2013
Location: Sumter SC, USA
Distribution: MX, Lubuntu
Posts: 449

Rep: Reputation: Disabled
A question for you: If we do your work do we get your degree (or certificate)?
 
Old 02-08-2016, 09:55 AM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Did you have a question about your homework?
 
Old 02-08-2016, 11:04 AM   #7
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
Quote:
Originally Posted by chilla101 View Post
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.
Yes.
 
Old 02-08-2016, 11:07 AM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by psionl0 View Post
Yes.
It does seem an odd question. Last time I did any vending machine code, it was exactly "that", machine code. Ah, the good old 8051 ...
 
  


Reply

Tags
c++, java, program, programming



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
Need C++ programmer help building simple Vending Machine program chilla101 Linux - Newbie 1 02-08-2016 07:17 AM
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
Programmer needed for simple game. JasonByers Programming 2 04-06-2007 08:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:37 PM.

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