Making choices
If Statement
“If statements” are just like making the right decision.
If it is raining then open your umbrella.
Operators
Operators are used to make comparisons.
Eg: if(age < 18) then you are underage.
Timer
This is an example of an If statement.
The timer block counts the time from the start of your program.
What happens in this program?
Try this yourself.
If/Else
Else can also be used in your if statement.
If traffic light is green, go Else(otherwise), stop.
If/Else
Using an if/else statement with timer
What happens in this program?
Try this yourself.
Making Choices: Completed
Now let’s move on to the next chapter :)
Take me to the next chapter!
Some of you who have experience with programming may have already used them.
You can actually use these statements with robots too