Selection is how a program chooses between different actions depending on the data. In this lesson we cover the IF statement in all its forms, the CASE OF statement, and how to build the Boolean conditions that drive those decisions.
1. In Cambridge pseudocode, which operator means not equal to?
2. A program must output a different message for exam grades A, B, C, D and E based on a single grade variable. Which structure is usually the clearest?
3. Trace this code with mark set to 64. What is output? mark <- 64 IF mark >= 70 THEN grade <- "A" ELSE IF mark >= 60 THEN grade <- "B" ELSE grade <- "C" ENDIF ENDIF OUTPUT grade
4. The condition NOT (x > 5) is true for which values of x?
Practise real exam questions on this
Type your answer, see your mark against the mark scheme in seconds. Free, 5 a day.
Start practising →
Teaching this topic?
Mark your whole class's answers and see who's stuck, for £19 a month.
See the class plan →
Free revision content. Multiple-choice answers are marked instantly. Written answers are marked by AI on /free-mark.