Program Flow

Cards (7)

  • IF statments usually have an IF - THEN - ELSE structure
  • IF-statements allow you to check if a condition is true or false , and carry out different actions depending on the outcome
  • If there is nothing for the program to do when the condition is false , the ' ELSE ' part should be left out
  • How can more complex IF statements be made?
    By putting one IF statement inside another - this type of selection statement is called a nested IF-statement
  • Nested IF statements allow you to check more conditions once you've established the previous condition is true
  • Nested IF statements allow multiple outputs
  • IF-ELSEIF statements can be used to check multiple conditions - They are different from nested IF statements as they only check more conditions if the previous condition is false