User Guide

Advanced
Coding Card
Pack
CONDITIONAL STATEMENTS
A statement helps a computer decide what to do next. A condition statement has an
If/Then format. For example, If v = 1, then turn left
if( condition here is true ){ run all of these code statements } else{ run these
statements}
An “if” statement creates a branch within your program so that your code 'makes
decisions'. It tests a condition and, if that condition is true, some code statements will
run. If the condition is false, the 'if' statement is passed over.
The “then” statement performs the following code if the condition is true.
The optional “else” statement performs the following code if the condition is false.
This ends and closes the entire IF statement.
40