Conditional+statements

Introduction
So far you have learned how variables work, and how to produce arithmetic calculations. All the code you have written so far is executed in **sequence** - each line of code gets run after the previous one.

media type="custom" key="22043390"

The next step is to understand how we can program a computer to make a decision e.g.


 * If a person's age is over 12 then display a message
 * If a game character touches the fire then lose a life
 * If the password has less than 5 characters then display an error message

We can write decision making code using **IF...THEN** statements or **IF...THEN...ELSE** statements. These are also known as [|conditional] statements. And IF...THEN..ELSE statement takes the form:

If condition A is true Then Perform Action X Else Perform Action Y End If

Here is an example of an if...then...else statement in Real Basic:



Tutorial
[|Age and Status]

Task 1
Pass Fail

Task 2
CD Review