Vending Machine sudo code

Thread Starter


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




Joined Apr 28, 2012
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):


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