954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

pseudocode help

I have to write a very simplified version of pseudocode for a vending machine for my computer class, and I really need some help PLEASE!
I do not know if what I have makes sense or even if the variables are right.
Here is what I have so far:

START
TYPE "Make A Selection"
Read Selection
Read Price
Let change = $1.00 - price
DO WHILE change is greater than or equal to $0.25
Dispense a quarter
IF change is less than $0.25
calculate amount of change due to customer
DO WHILE change is greater than or equal to $0.10
dispense a dime
IF change is less than $0.10
calculate amount of change due to customer
DO WHILE change is greater than or equal to $0.05
dispense a nickel
IF change is equal to $0.00
dispense selection
TYPE "Thank You"
END

My list of variables:
Price $0.05 - $1.00
Change $0.00 - $0.95
One dollar bill = $1.00
Quarter = $0.25
Dime = $0.10
Nickel = $0.05

lunalustar
Newbie Poster
1 post since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: