Diagram Desk

Vending machine flowchart

Insert money, choose a drink, get change. A loop back for more coins and a sold-out branch in one small diagram.

The diagram

StartInsert moneyChoose a drinkSold out?Ask for another choiceMoney ≥ price ?Show the shortfallDrop the drinkReturn changeEndyesnonoyes
Flowchart · 10 shapes

Reading it step by step

  • 1. Start at 'Start'.
  • 2. 'Insert money' is an input or output. Next: 'Choose a drink'.
  • 3. 'Choose a drink' is an input or output. Next: 'Sold out?'.
  • 4. Decide 'Sold out?': if 'yes', go to 'Ask for another choice'; if 'no', go to 'Money ≥ price ?'.
  • 5. 'Ask for another choice' is a processing step. Next: 'Choose a drink'.
  • 6. Decide 'Money ≥ price ?': if 'no', go to 'Show the shortfall'; if 'yes', go to 'Drop the drink'.
  • 7. 'Show the shortfall' is a processing step. Next: 'Insert money'.
  • 8. 'Drop the drink' is a processing step. Next: 'Return change'.
  • 9. 'Return change' is a processing step. Next: 'End'.
  • 10. End at 'End'.

Shape by shape

ShapeSymbolConnections
StartTerminator→ Insert money
Insert moneyInput/output→ Choose a drink · ← Start, Show the shortfall
Choose a drinkInput/output→ Sold out? · ← Insert money, Ask for another choice
Sold out?Decision→ Ask for another choice(yes), Money ≥ price ?(no) · ← Choose a drink
Ask for another choiceProcess→ Choose a drink · ← Sold out?
Money ≥ price ?Decision→ Show the shortfall(no), Drop the drink(yes) · ← Sold out?
Show the shortfallProcess→ Insert money · ← Money ≥ price ?
Drop the drinkProcess→ Return change · ← Money ≥ price ?
Return changeProcess→ End · ← Drop the drink
EndTerminator← Return change

Symbols used here

SymbolMeaning
TerminatorWhere the flow starts or ends; a rounded rectangle.
ProcessOne action such as a calculation; a rectangle.
DecisionA question whose answer picks the next path; a diamond.
Input/outputData comes in or goes out; a parallelogram.
Flow lineThe order of steps, in the arrow direction.

All flowchart symbols and how to draw

Diagram text

Paste this text into the editor to get the same picture, then change the names to fit your own work.

# Vending machine flowchart
flowchart TD
  s(["Start"])
  a[/"Insert money"/]
  b[/"Choose a drink"/]
  c{"Sold out?"}
  d["Ask for another choice"]
  e{"Money ≥ price ?"}
  f["Show the shortfall"]
  g["Drop the drink"]
  h["Return change"]
  z(["End"])
  s --> a
  a --> b
  b --> c
  c -->|yes| d
  d --> b
  c -->|no| e
  e -->|no| f
  f --> a
  e -->|yes| g
  g --> h
  h --> z

More flowchart examples

All SeewolLabs tools