Please enable JavaScript.
Coggle requires JavaScript to display documents.
2.2 Programming Constructs (Selection (If/Else (*Instructions executed…
2.2 Programming Constructs
Sequence
Until the end of the sequence is reached
Each instruction on a separate line
Instructions executed in order they are written
First instruction at the top
Iteration
Also known as a loop
Repeat instructions: Forever, Until condition is met
Selection
A decision is made about which code to execute next
Represented by branches in your flowcharts
Uses conditional statement
If/Else or Select Case
If/Else
*Instructions executed ONLY if condition is TRUE
*If conditions is FALSE a different set of instructions can optionally be executed
Tests if a condition is TRUE OR FALSE
Switch case
Selects one instruction to run from a set of possible instructions
Determined by value of a variable
Use instead of multiple 'else statements'- it's much more efficient