What’s the flow of a program?
The order that the steps are carried out in.
How can you control the program flow?
Using selection statements: IF statements and CASE statements.
What is an IF statement?
Allows you to check if a condition is true or false, and carry out different actions depending on the outcome.
What is a nested IF statement?
Putting another IF statement inside another.
What does a nested IF statement allow?
What is IF-ELSEIF statement?
Used to check multiple conditions. They’re different from nested IF statements as they only check more conditions if the previous condition is false.
What is a SWITCH-CASE statement?
Instead of checking if a statement is true or false, it checks if a variable has specific values.
What are SWITCH-CASE statements used for?
When you want a program to perform different actions for different values of the same variable.
How are SWITCH-CASE statements different to IF statements?
They have a smilier structure but SWITCH-CASE statements give a neater way to test different values of a variable, this makes them easier than ELSEIF statements to maintain.
What is a disadvantage of SWITCH-CASE statements?
They can only check the value of one variable.
What is a FOR loop?
It’ll repeat the code inside a fixed number of times. The number of times that the code repeats will depend on an initial value, end value and the step count.
What makes SWITCH-CASE statements more robust?
They include a ‘default’ case which tells the program what to do if none of the other cases are correct.
What are DO UNTIL loops?
What are WHILE loops?
What are DO WHILE loops?