A compiler translates source code into machine code.
Identify why a compiled program can be run on a computer that does not have the compiler installed.
Mark scheme
- C The object code is saved as a separate file (1)
- The only correct answer is C. The correct answer is the object code is saved as a separate file.
- A is not correct because a compiled program is not translated again when it is run
- B is not correct because translating one line at a time is how an interpreter works
- D is not correct because the source code is not needed to run a compiled program
Example answers and how they were marked
C The object code is saved as a separate file
Why: Selected the saved object code, which can be run without the compiler being present (1).
D The source code is saved with the program
Why: Near miss: it is the object code, not the source code, that is saved and run on another computer.
B The code is translated one line at a time
Why: Confuses a compiler with an interpreter: a compiled program is translated as a whole and is not translated again when it is run.