Y11 GCSE Computer Science
PRIMM Activities: OCR Reference Language Selection
Focus topics: IF-THEN-ELSE, ELSEIF, and CASE SELECT / SWITCH.
Activity 1: Predict & Run
Read each selection program, choose the best output, then run it to check.
Predict 1: Simple IF-ELSE
Console
Press "Run this code" to see output.
Predict 2: IF, ELSEIF, ELSE
Console
Press "Run this code" to see output.
Predict 3: SWITCH Day Checker
Console
Press "Run this code" to see output.
Predict 4: Grade Boundaries
Console
Press "Run this code" to see output.
Predict 5: Input with SWITCH
Console
Press "Run this code" to see output.
Activity 2: Investigate (Parsons Problem)
- Drag and reorder the blocks to build the correct OCR selection program.
- The program should check whether the temperature is hot, warm, or cold.
- Use one IF line, one ELSEIF line, and one ELSE line.
- Finish with
endif.
Activity 3: Modify
- The starter program already asks for a number.
- Add an
elseif branch for zero.
- Keep the existing positive and negative outcomes working.
Console
Run your code to check it.
Activity 4: Make
- Use the IDE to rewrite the vending machine state algorithm using
if statements instead of switch.
- Ask for the new state:
on, off, or suspended.
- Set
statevalue to 1, 2, or 3 for the matching state.
- Print
Invalid state if the input does not match any valid option.
- Add one
// comment to explain your selection logic.