I have to write a vending machine program that has four diferent items in it. It accepts users money and dispenses candy and change if possible.
I don't know where to start. Can someone point me in the right direction?
I have to write a vending machine program that has four diferent items in it. It accepts users money and dispenses candy and change if possible.
I don't know where to start. Can someone point me in the right direction?
It would help if your subject line was "Homework" then we all know what to expect.
Show us what you've tried and how it didn't work, then we'll help. Generally, if your question screams homework we won't jump as quickly as with a legitimate question.
-Prelude
My best code is written with the delete key.
YES!!!! It is homework. I wasn't asking for you to write any code just a point in the right direction. I posted it on another discussion board and they were a lot more friendly. I am just learning how to program and am not an expert....like you guys....I have to start somewhere......I don't think you were born as programmers.
Just asked for help!!!! This is a duscussion board for help isn't it?
>I posted it on another discussion board and they were a lot more friendly.
No offense, but we aren't concerned about your feelings. We're here to answer detailed questions in a detailed and efficient manner.
>I don't think you were born as programmers.
No, we worked hard at it by solving problems and making mistakes on our own. To deny you that kind of learning experience would hurt you more than you think, this is why we don't answer homework questions without letting you have a shot at it first.
>Just asked for help!!!! This is a duscussion board for help isn't it?
Yes it is, but we've specified the homework situation many times in both the FAQ and sticky messages on all boards.
To be perfectly honest, this is not exactly a trivial program when written correctly and a point in the right direciton could mean anything. If you want better answers, ask better questions. You can find out how in the smart questions link of my signature, it's very informative. And please don't overreact if you feel you're being treated unfairly. If you are then the person at fault will get called on it very quickly, otherwise it is within the bounds of acceptable behavior and you should ignore it.
-Prelude
My best code is written with the delete key.
Preluse i wanna cry every time i read your posts....
You have an answer for everything and im just feedin your ego arent i?
But prelude is right.. these ppl only want to help you, while not answering your question now might no look like help... youll appreciate it oneday down the road
Someone 20 yrs from now:
"That prelude really knew his stuff back in the day"
er.. sorry prelude for using you in past tense :P
What is C++?
here is a little part dude
that should give you an idea the basic on the design what you want to do is display options -> take input -> determine where to go -> output. This type of program is simple if you just think. Also reading atleast 1 through 8 of the tutorials here this should all make sense.Code:#include <iostream.h> #include <conio.h> void vend (int drink); int main() { cout<<"1. Coke"<<endl; cout<<"2. Sprite"<<endl; cout<<"3. Dr. Pepper"<<endl; cout<<"4. Red Bull, yummy"<<endl; char choice; choice = getch(); switch(choice) { case 1: //blah
+++
++
+ Sekti
++
+++