Skip to content

Nested decisions

One speed, three outcomes

  • A speed camera: 120 or more loses the licence, 100 or more is a fine, and anything lower is ok.
  • One IF has two paths. The second decision goes inside the ELSE, as its own IF.
  • Each IF has its own ENDIF. Indent the inner one so you can see which ELSE it belongs to.

Speed >= 120 TRUE gives licence taken; when FALSE, Speed >= 100 TRUE gives fine and FALSE gives ok; 130, 105 and 100, and 90 follow those paths

Handout

Log in or create account

IGCSE, A-Level & AP