| OCR |
GCSE (9-1) Computer Science
Mark Scheme
J277/02: Unit 2.5 - Translators
|
| Question | Answer | Marks | Guidance |
|---|---|---|---|
| 1 |
1. Source (Accept "High-level") 2. Executable 3. One-by-one (Accept "Line-by-line") |
3 |
Gap 2: Do not accept "Binary" - it must imply a file.
|
| 2a |
- Lines 1 to 9 will run/execute (1). - The program will stop/crash at Line 10 and display the error (1). |
2 |
Ghost Topic: Students must realize an Interpreter executes valid code up until the crash.
|
| 2b |
- The program will not run at all (1). - A list of errors (including Line 10) is reported after the attempt finishes (1). |
2 |
A compiler generates nothing executable if even one error exists.
|
| 3 |
Translator: Compiler (1) Reasons (Any two): - Creates an executable file (user doesn't need Python) (1). - Protects the source code (proprietary protection) (1). - Optimizes the code for faster execution (1). |
3 |
If "Interpreter" is chosen, award 0 for the whole question.
|
| 4 |
- The compiler converts code into machine code once before running (1). - The interpreter must translate every line every time it runs, taking CPU time during execution (1). |
2 |
Focus must remain on execution efficiency, not translation time.
|
| 5 |
Indicative Content: - The Process: Interpreter runs one line at a time and pauses (1). - Visibility: Programmer can inspect variable values in the Watch Window during the pause (1). - Logic Errors: These don't crash code but give wrong results. Watching variables change line-by-line shows exactly where it goes wrong (1). - Vs Compiler: A compiler produces a "black box" executable; you cannot easily pause to check internal memory states (1). |
6 |
L3 (5-6 marks): Links Interpreter mechanics to IDE stepping and variable inspection for debugging wrong results.
|