Flowcharts#
Learning goals
translate a process into a flowchart
Mission: Safe landing#

Fig. 8 Lunar lander trying to land#
Problems:
limited fuel 🌡️
crash if high speed 💥
How do we control ❓
Flowcharts#
We can use flowcharts to represent the process of safe landing.
flowchart LR A(Start) --> B[Look at the clock] B --> C{ is time >= 12:00 and time < 12:30?} C -->|No| D{ is time >= 19:00 and time < 20:00?} D -->|Yes| E C -->|Yes| E[🍽️ Eat] D -->|No| F[🖥️ Work for 25 minutes] F --> G(End) E --> G
Tip
Draw the flowchart top to bottom, if you prefer.
Main symbols:
name |
shape |
---|---|
process |
▯ (rectangle) |
decision |
◇ (diamond) |
start or ending |
If you heard of activity diagrams: Flowcharts are a basic form of them.
Activity 1
Draw a flowchart for the following program
if the altitude is higher than 100
the thruster must be off.
if the altitude is lower than or equal 100
turn on the thruster
if the altitude lower than or equal 0 (landing)
the thruster must be off.
Steps:
8 min work individually.
2 min compare with your partner’s.