Conditional Statements

A type of coding instruction used to compare values and express and make decisions. A conditional statement tells a program to execute an action depending on whether a condition is true or false. It is often represented as an if-then or if-then-else statement.

The example above is a sequence of code which uses a conditional statement known as an "if/then" block. The video below is a demonstration of the code in action. Please notice that the Ball sprite will only leave a stamp if it's random x position is greater than 100. Having students create and alter code of this nature corresponds with Mathematics Grade 5 B2.1, C2.4, C3.1, 3.2.

Grade 5 Conditional Statements.m4v

Try it now!

To practice with conditional statements, access our Scratch Playground here ⤵️