| OCR |
GCSE (9-1) Computer Science
Mark Scheme
J277/02: Unit 2.1 Writing Algorithms
|
| Question | Answer | Marks | Guidance |
|---|---|---|---|
| 1a | 12.50 | 1 | |
| 1b | 35.00 | 1 |
Examiner Note: Tests understanding of 'default' or 'else' paths.
|
| 1c |
if destination == "UK" then cost = 5.00
|
3 |
1 mark for first IF.
1 mark for ELSE IF structure.
1 mark for correct logic including else/default.
|
| 2 |
Is Price > 50?: False (or No) (1) Discount: 0 (1) Output: 0 (1) |
3 |
Examiner Note: 50 is NOT greater than 50.
|
| 3 |
|
2 | |
| 4a | Line 02 | 1 | |
| 4b |
if age >= 17 then OR if age > 16 then
|
1 | |
| 4c | The program runs/does not crash (1) but produces the wrong output/outcome (1). | 2 | |
| 5a |
The variable password is never updated inside the loop (1). The condition password != "Secret" stays True forever (1).
|
2 | |
| 5b |
password = input("Enter password")
|
2 |
Award 1 mark if they write 'input password' but forget to assign it to the variable.
|
| 6 |
Explanation: The computer evaluates "Blue" as a separate boolean statement (which is always True/Non-zero) rather than comparing it to colour (1). Correct Code: if colour == "Red" OR colour == "Blue" then (2)
|
3 |
This is a very common syntax error in J277.
|
| 7 |
1. Inputs assigned to variables (p = input, m = input) (1) 2. Calculation (change = m - p) (1) 3. Correct Selection (if change < 0) (1) 4. Correct Output for insufficient funds (1) 5. Correct Output for change (must be in else block) (1) |
5 | |
| 8 |
1. Initialising total = 0 (Crucial step) (1)2. Loop repeats 5 times (1) 3. Input inside the loop (1) 4. Running total calculation (1) 5. Calculation of average outside the loop (1) 6. Final output (1) |
6 | |
| 9 |
1. Start/Stop terminals (rounded) (1) 2. Input parallelogram (1) 3. First Decision Diamond (temp < 0) (1) 4. Second Decision Diamond (temp > 100) (1) 5. Correct output parallelograms for all 3 outcomes (1) 6. Flow lines connect correctly (logic flows one way) (1) |
6 | |
| 10 |
1. Boolean flag set (e.g., found = False) OR valid index loop (1) 2. Iteration through array (1) 3. Comparison (if students[i] == "Sarah") (1) 4. Action if found: print "Found" (1) 5. Action if found: break loop OR set flag found = True (1) 6. Check after loop (if found == False) (1) 7. Output "Not Found" (1) |
7 |
Note: Many students print "Not Found" inside the loop for every non-match. This is incorrect.
|