Vending Machine sudo code

Discussion in 'Homework Help' started by circuitme, Nov 17, 2012.

  1. circuitme

    Thread Starter New Member

    Nov 10, 2012
    6
    0
    I am to write pseudo code for behavior of a vending Machine which dispenses a .25 cent product. The machine can accept Nickles, dimes, and Quarters.

    I chose to write in a language near to C++, and I chose my product to be canned drinks, yeah i know cheap. Anyway, I need someone to look over what I have done and tell me if I did anything wrong. You will find my attachment with my work below.

    Thanks
     
  2. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    Your pseudo code is neither C++ nor C, it reminds of BASIC.

    It is unclear to me why you dispense the change in a loop,
    and why you use two loops.

    A little later you dispense the change a second time.

    I'd go over that again.

    If you talk C language, you'd use { and },
    as well
    Code ( (Unknown Language)):
    1. if(condition)statement;
     
  3. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I don't know if your teacher is a nitpicker (like me) or not, but if so, he/she will likely criticize your use of .25 cents to mean 25 cents. If you want to put a decimal point in front of 25, then it is .25 dollars, not .25 cents.
     
  4. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
    I'd make a flowchart, and based on that start the development with the "stepwise refinement" - method.
     
Loading...