IF Commands

There are two different types of IF command available in Coco. If...Then and If...Then...Else


If ..Then looks at a condition to see if it is True or False.

 

E.g. checking to see if an Input is On (True) or Off (False).

If it is True then it runs a piece of code but if it is False it skips over the code and continues with the code that starts on the next line after the End if.. code.

IF_THEN

If ..Then.. Else also looks at the condition but it is more sophisticated.

 

If the condition is True it runs one piece of code but if it is False it runs a different piece of code.


else



task

With a partner, create and save the two procedures above. Explain to each other what they do and how you think they work.

accuracy