Selection (IF statements)

    AQA
    GCSE

    Selection constructs enable programs to execute specific code paths based on the evaluation of Boolean conditions, fundamental to algorithmic decision-making. Candidates must demonstrate mastery of `IF`, `ELSE IF` (or `ELIF`), and `ELSE` structures, alongside `SWITCH`/`CASE` statements where specified. Proficiency requires the accurate construction of complex logical expressions using relational and Boolean operators (AND, OR, NOT) to control flow. Examiner reports emphasize the necessity of correct syntax in nesting and the precise application of comparison operators to prevent logical runtime errors.

    0
    Objectives
    3
    Exam Tips
    3
    Pitfalls
    4
    Key Terms
    4
    Mark Points

    What You Need to Demonstrate

    Key skills and knowledge for this topic

    • Award 1 mark for the correct use of the comparison operator (e.g., ==, !=, >=) within the condition statement
    • Credit responses that correctly indent code (Python) or use delimiters (End If) to define the scope of the selection block
    • Award 1 mark for the correct logical structure of nested IF statements to handle multiple dependent conditions
    • Credit the use of ELIF/ELSE IF structures for multi-way branching over inefficient independent IF statements

    Marking Points

    Key points examiners look for in your answers

    • Award 1 mark for the correct use of the comparison operator (e.g., ==, !=, >=) within the condition statement
    • Credit responses that correctly indent code (Python) or use delimiters (End If) to define the scope of the selection block
    • Award 1 mark for the correct logical structure of nested IF statements to handle multiple dependent conditions
    • Credit the use of ELIF/ELSE IF structures for multi-way branching over inefficient independent IF statements

    Examiner Tips

    Expert advice for maximising your marks

    • 💡When writing pseudocode, clearly align your IF, ELSE, and END IF keywords to unambiguously show which statements belong to which branch
    • 💡In trace table questions, explicitly evaluate the condition (e.g., write 'True' or 'False') before updating any variables to prevent cascading errors
    • 💡Check if a 'default' action is required; if so, ensure you include a final ELSE clause to catch all remaining possibilities

    Common Mistakes

    Pitfalls to avoid in your exam answers

    • Confusing the assignment operator (=) with the equality comparison operator (==) inside the condition
    • Incorrect indentation leading to logic errors where statements execute unconditionally outside the intended selection block
    • Failing to handle boundary values correctly (e.g., using > instead of >=), resulting in off-by-one logic errors

    Key Terminology

    Essential terms to know

    Likely Command Words

    How questions on this topic are typically asked

    Develop
    Trace
    Explain
    Complete
    Correct

    Practical Links

    Related required practicals

    • {"code":"Paper 1 Programming","title":"Algorithm Design","relevance":"Selection is a fundamental building block for all algorithmic solutions tested in Paper 1"}

    Ready to test yourself?

    Practice questions tailored to this topic