Thread: Vending machine

  1. #1
    Unregistered
    Guest

    Question Vending machine

    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?

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    589
    It would help if your subject line was "Homework" then we all know what to expect.

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    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.

  4. #4
    Unregistered
    Guest
    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?

  5. #5
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >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.

  6. #6
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    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++?

  7. #7
    Registered User Sekti's Avatar
    Join Date
    Feb 2002
    Posts
    163
    here is a little part dude

    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
    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.
    +++
    ++
    + Sekti
    ++
    +++

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Vending Machine Logic?
    By shwetha_siddu in forum C Programming
    Replies: 10
    Last Post: 04-07-2009, 03:33 AM
  2. Replies: 4
    Last Post: 01-18-2008, 07:05 PM
  3. School Mini-Project on C/C++ (Need Your Help)..
    By EazTerence in forum C++ Programming
    Replies: 4
    Last Post: 09-08-2005, 01:08 AM
  4. Porting from 32 bit machine to 64 bit machine!
    By anoopks in forum C Programming
    Replies: 10
    Last Post: 02-25-2005, 08:02 PM
  5. Wanna test vending machine
    By Roaring_Tiger in forum Tech Board
    Replies: 6
    Last Post: 08-25-2004, 05:51 PM