Writing exam answers about languages, translators and IDEs

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Writing exam answers about languages, translators and IDEs

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which answer earns the mark for the advantage of a compiler?
A A compiler gives faster execution because the whole program is already translated into an executable file.
B A compiler is better because it is more useful.
2. Which statement about an interpreter is correct?
A An interpreter translates the whole program and creates an executable file.
B An interpreter translates and runs one line at a time, so it does not create an executable file.
3. Which answer correctly describes the role of an assembler?
A An assembler translates high-level code into assembly language.
B An assembler translates assembly language into machine code.
4. Which sentence uses the correct term?
A Assembly language uses mnemonics, and it must be assembled into machine code.
B Assembly language is machine code because it uses mnemonics.
5. Which answer links an interpreter's advantage to a reason?
A An interpreter is useful when developing because errors are reported line by line as the code runs.
B An interpreter is useful when developing because it is quick.

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1A compiler runs faster because the whole program is already translated AA full-mark description of an assembler's role: it names the correct input and output
2An assembler translates assembly language into machine code BAuto-completion suggests code as you type, which saves time and reduces typing errors
3Describing an IDE function with its purpose, so the point is linked to a reason CAssembly language uses mnemonics, not binary. Machine code is the binary, and an assembler is needed to translate assembly into it.
4Explaining why an interpreter suits development by linking the point to a reason DA full-mark comparison: it gives the correct term, a point and a linked reason using 'because'
5An interpreter creates an executable file so it runs faster EAn interpreter is useful when testing because it stops at an error and shows the line
6Assembly language is machine code because it uses binary FA compiler creates the executable file, not an interpreter. An interpreter translates and runs line by line without making one.

Definitions

point because reason

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
A compiler runs faster _______ the whole program is already translated.
2.
An ___________ translates line by line so it stops at the first error.
3.
An _________ translates assembly language into machine code.
4.
A compiler produces an __________ file, but an interpreter does not.
5.
___________ colours and indents code so it is easier to read.

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A Compiler programs run faster
B because it reads line by line
C translated to machine code.
Question 2
A An interpreter is useful
B when developing a program
C because it stops at an error
D so an executable file is made.
Question 3
A An assembler translates
B high-level code into
C machine code.
Question 4
A Auto-completion runs the code
B as the user types, which
C reduces typing mistakes.
Question 5
A Compiler disadvantage:
B the whole program must be
C compiled again after a change
D so testing is much quicker.

Answer Key

Writing exam answers about languages, translators and IDEs
Section A: Quick Questions
Q1
A — A compiler gives faster execution because the whole program is already translated into an executable file.
Q2
B — An interpreter translates and runs one line at a time, so it does not create an executable file.
Q3
B — An assembler translates assembly language into machine code.
Q4
A — Assembly language uses mnemonics, and it must be assembled into machine code.
Q5
A — An interpreter is useful when developing because errors are reported line by line as the code runs.
Section B: Match the Pairs
Q1
A compiler runs faster because the whole program is already translated → A full-mark comparison: it gives the correct term, a point and a linked reason using 'because'
Q2
An assembler translates assembly language into machine code → A full-mark description of an assembler's role: it names the correct input and output
Q3
Describing an IDE function with its purpose, so the point is linked to a reason → Auto-completion suggests code as you type, which saves time and reduces typing errors
Q4
Explaining why an interpreter suits development by linking the point to a reason → An interpreter is useful when testing because it stops at an error and shows the line
Q5
An interpreter creates an executable file so it runs faster → A compiler creates the executable file, not an interpreter. An interpreter translates and runs line by line without making one.
Q6
Assembly language is machine code because it uses binary → Assembly language uses mnemonics, not binary. Machine code is the binary, and an assembler is needed to translate assembly into it.
Section C: Definitions
Q1
point because reason — A full-mark answer states a point with the correct term, then links it to a reason, e.g. a compiler runs faster because the whole program is already translated.
Section D: Fill in the Blanks
Q1
A compiler runs faster because the whole program is already translated.
Q2
An interpreter translates line by line so it stops at the first error.
Q3
An assembler translates assembly language into machine code.
Q4
A compiler produces an executable file, but an interpreter does not.
Q5
Prettyprint colours and indents code so it is easier to read.
Section E: Spot the Error
Q1
B — A compiler runs faster because the whole program has already been translated. Reading line by line describes an interpreter. The line should say 'because all code is already'.
Q2
D — An interpreter does not make an executable file. It translates and runs line by line, so it stops at the error and the fault can be fixed. The line should say 'so the fault can be fixed.'
Q3
B — An assembler translates assembly language, which is low-level, into machine code. It does not translate high-level code. A compiler or interpreter does that.
Q4
A — Auto-completion suggests code as the user types. Running code is the job of the run-time environment. The line should say 'Auto-completion suggests code'.
Q5
D — The reason given must fit the point. Compiling the whole program again after every change makes testing slower, not quicker. The line should say 'so testing takes longer.'