Learn in the textbookControl Structures and Notation Methods
DefinitionSelection (選択) is a control structure that switches the next step depending on whether a condition (条件) holds (true) or does not hold (false).
ExplanationSelection is also called branching (分岐); in a diagram, one line leaves the diamond-shaped decision (判断) symbol for each result, such as true and false (Yes and No). Placing one selection inside another divides processing into three or more paths.
AnalogyIt works like a station ticket gate: a valid ticket opens the gate, and an invalid one keeps it shut.
Memory hookPrograms usually write a selection starting with the word if.