| OCR |
GCSE (9-1) Computer Science
Mark Scheme
J277/02: Unit 2.3 Robust Programs
|
| Question | Answer | Marks | Guidance |
|---|---|---|---|
| 1 |
(a) Normal (1) (b) Invalid (or Boundary Invalid) (1) (c) Erroneous (1) |
3 |
"Invalid" is the standard term for wrong range but correct type.
|
| 2 |
(a) 11 (1) (b) Invalid (or Boundary Invalid) (1) (c) Erroneous (1) |
3 |
Strict: (a) Must be exactly 11. 10 or 12 are incorrect.
Do not accept "Erroneous" for 19 (it is the right type, just wrong range).
|
| 3 |
(a) It is too vague / It does not explain what is being tested. (1) (b) To check that a password shorter than 6 characters (5 chars) is rejected. (2) |
3 |
Must mention "Length", "Short", or the specific character count. "To see if it works" is never credited.
|
| 4 |
(a) "ABCDE" (Any string exactly 5 chars long) (1) (b) "ABCDEFGHIJ" (Any string exactly 10 chars long) (1) (c) Error message displayed / User asked to input again. (2) |
4 |
The content of the string doesn't matter, only the length.
0 Marks for "Program crashes" or "Nothing happens". Robust programs do not crash.
|
| 5 |
(a) Runtime Error (or Execution Error) (1) (b) num = input("Enter number")
|
4 |
The key is using logic (try/except or isnumeric check) to prevent the conversion crash.
|
| 6 |
(a) It does not handle the number 16 (gap in logic). (1) (b) Nothing / Blank / No Output (1) (c) Entering 16 is the exact boundary (1). It would show the programmer that 16 produces no result, highlighting the missing = sign. (1) |
4 |
age < 16 and age > 16 leaves 16 undefined. Neither if nor elif is triggered.
|
| 7 |
(a) Should be: Invalid (1). Reason: It is the correct data type (Integer) but outside the range. (1) (b) Should be: Erroneous (1). Reason: It is the wrong data type (String input for Integer field). (1) |
4 |
J277 Definition: Invalid = Right type, wrong range. Erroneous = Wrong type.
|