IF+Statements

Programming a Computer to Make Decisions


 * IF Statements are a way of programming a computer to make decisions.
 * The Simplest IF Statement looks like this:

If something is true, carry out the commands in the gap. If It's not true, it will do nothing. For Example:



In this example, If we enter someones age as over 16, the sprite will say "You can drive".

If their age is not more than 16 then it will do nothing!

See the next page for further examples of If Statements - and a Task.