Curriculum

Curriculum

Turn a Flowchart into Pseudocode

Scenario

The flowchart reads free seats and accepts a booking when the count is above zero.

  1. 1…
  2. 2…
  3. 3…

Try it yourself

Select the operations in the order the pseudocode should perform them.

Reveal the explanation
  1. READ free seats

    This corresponds to the input box.

  2. IF free seats > 0

    This corresponds to the decision diamond.

  3. 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.