# Vending Machine sudo code

#### circuitme

Joined Nov 10, 2012
6
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

#### Attachments

• 690.8 KB Views: 46

#### takao21203

Joined Apr 28, 2012
3,682
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
Rich (BB code):
if(condition)statement;

#### tracecom

Joined Apr 16, 2010
3,940
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.

#### nerdegutta

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