The flowchart starts with a customer choosing a drink and inputting the code for the drink. The machine finds the price for the drink in its database. The customer inserts coins. The vending machine counts the coins. If the coins inserted by the customer equal the can value, the customer receives the can. If the inserted coins have a larger value than the can value, the customer receives the can and the change.
Vending Machine diagram code in Gleek
inserted = 0
inserted = inserted + coinValue
inserted >= price:diamond
start–>get CanID–>get price–>inserted = 0–>received coin–>get coinValue–>inserted = inserted + coinValue–>inserted >= price-yes->drop can–>change–>end
inserted >= price-no->inserted = 0
get CanID–>cans database
cans database–>get price
A flowchart, or flow chart, is a type of diagram that shows a step-by-step view of a process. Flowcharts document the tasks and decisions needed to achieve a specific goal. A basic flowchart is easy to make and understand. Businesses, engineers and software designers often use flowcharts to diagram their ideas.