Time allowed: 20 minutes
| Centre number |
| | | |
|
Candidate number |
| | | |
| First name |
|
Last name |
INSTRUCTIONS
- Use black ink.
- Answer all the questions.
INFORMATION
- The total mark for this paper is 18.
- The marks for each question are shown in brackets [ ].
Turn over
Section A: Knowledge Recall (Gap Fill)
1
Complete the sentences below using the most appropriate terms from the list provided.
[3]
List: [ Assembly, High-level, Machine, Executable, Source, One-by-one ]
A Compiler translates the entire ................................. code in one go.
If there are no errors, it produces an ................................. file.
An Interpreter translates and runs the code ................................. line at a time.
Section B: Application & Debugging
2
A programmer is writing a program in Python to calculate the area of a circle. The code contains a
Syntax Error on Line 10. The program is 20 lines long.
(a) If the programmer uses an
Interpreter, describe exactly what happens when they try to run the code.
[2]
(b) If the programmer uses a
Compiler, describe exactly what happens when they try to translate the code.
[2]
3
A software team has finished creating a new video game. They are ready to sell it to customers online.
State which type of translator (Compiler or Interpreter) they should use to prepare the file for customers. Give two reasons for your choice.
[3]
Translator: ............................................................................................
Reason 1: .....................................................................................................
Reason 2: .....................................................................................................
Turn over
Section C: Deep Theory & Performance
4
It is often stated that "Compiled code runs faster than Interpreted code."
Explain why this statement is true.
[2]
Note: Do not discuss the speed of translation. Focus on the execution.
5
Many IDEs allow the programmer to "Step through" code line-by-line using a Run-Time Environment. Explain how this feature uses an
Interpreter to help the programmer find
Logic Errors.
[6]
In your answer, consider:
- What the interpreter does at each line.
- What the programmer can see happening in the variables/output.
- Why this is harder to do with a standard Compiler.
END OF QUESTION PAPER