ProgrammingTopic Summary

Knowledge Organiser: Selection

Part of Selection (IF Statements) · GCSE GCSE Computer Science revision

This topic summary covers Knowledge Organiser: Selection within Selection (IF Statements) for GCSE Computer Science. Revise Selection (IF Statements) in Programming for GCSE Computer Science with 15 exam-style questions and 8 flashcards. This is a high-frequency topic, so it is worth revising until the explanation feels precise and repeatable. It is section 10 of 10 in this topic. Use this topic summary to connect the idea to the wider topic before moving on to questions and flashcards.

Topic position

Section 10 of 10

Practice

15 questions

Recall

8 flashcards

Knowledge Organiser: Selection

Key Terms
  • Selection: A programming construct that executes different code depending on a condition
  • IF statement: Runs a block of code only if a condition is true
  • ELSE: The block that runs when the IF condition is false
  • ELSEIF: Checks an additional condition when the previous one is false
  • SWITCH/CASE: Compares one variable against many specific values
  • Nesting: Placing one IF statement inside another IF statement
Must-Know Facts
  • Every IF must be closed with ENDIF
  • Use == for comparison in conditions, not = (which is assignment)
  • ELSEIF checks are tested in order — first true condition wins
  • SWITCH/CASE is cleaner than many ELSEIFs when testing one variable
  • Indentation shows the structure of nested IF statements
  • DEFAULT in SWITCH runs if no CASE matches
Key Concepts
  • Basic IF: if condition then ... endif
  • IF-ELSE: if condition then ... else ... endif
  • IF-ELSEIF: if ... then ... elseif ... else ... endif
  • SWITCH: switch var: case "X": ... default: ... endswitch
  • Combine conditions: if username == "admin" AND password == "secret" then
Common Mistakes
  • Using = instead of == for comparison: In pseudocode conditions, == tests equality; = assigns a value — writing if age = 18 instead of if age == 18 is a common error
  • Forgetting ENDIF: Every IF statement must be closed with ENDIF — omitting it loses marks in pseudocode questions
  • Putting ELSEIF after ELSE: ELSE must always come last — ELSEIF conditions go between IF and ELSE, not after it
  • Not indenting nested IF statements: Each level of nesting should be indented consistently — poor indentation makes logic errors hard to spot and loses presentation marks
  • Using IF-ELSEIF chains when SWITCH/CASE is cleaner: When testing one variable against many fixed values, SWITCH/CASE is clearer — examiners may expect it for multi-way selection questions

Revise this topic interactively on PrepWise — self-test mode, tap-to-reveal definitions, and Common Mistakes from examiners.

Try the interactive Knowledge Organiser — free →

Keep building this topic

Read this section alongside the surrounding pages in Selection (IF Statements). That gives you the full topic sequence instead of a single isolated revision point.

Practice Questions for Selection (IF Statements)

Which programming construct is used to make a decision based on a condition?

  • A. FOR loop
  • B. IF statement
  • C. WHILE loop
  • D. Function definition
1 markfoundation

Explain the difference between using ELSEIF and using nested IF statements to test multiple conditions.

3 marksstandard

Quick Recall Flashcards

When use SWITCH?
Comparing one variable against many specific values
When use ELSEIF?
When you have multiple conditions to check

15 questions on Selection (IF Statements) — practise free

Instant marking, adaptive difficulty, and 8 spaced repetition flashcards. Free until your GCSEs.

Try PrepWise Free