Turn a Flowchart into Pseudocode
Scenario
The flowchart reads free seats and accepts a booking when the count is above zero.
- 1…
- 2…
- 3…
Try it yourself
Select the operations in the order the pseudocode should perform them.
Reveal the explanation
- READ free seats
This corresponds to the input box.
- IF free seats > 0
This corresponds to the decision diamond.
- RETURN accepted on Yes, declined on No
The branch determines the returned value.
Trace the diagram and the pseudocode with the same input. Both representations should return the same result.
Your turn
Write pseudocode for the seat check and show expected results for 0 and 1.
Common mistake Writing only the Yes outcome of a decision.
Check your work
The pseudocode has one input, a decision, and a return value on each path.
This browser could not save your progress. Changes last until you leave the page.