A compiler and an interpreter are two different types of translator.
- (a)(i)One similarity between a compiler and an interpreter is that they both translate high-level language into machine code. Give one other similarity between a compiler and an interpreter.[1]
- (a)(ii)Explain two differences between a compiler and an interpreter.[4]
Mark scheme
Marking points from the official mark scheme (May/June 2022). The mark or mark type is shown in brackets.
- [1] They both report/check for errors
- [4] Four from (MAX 2 per translator): An interpreter translates the code line by line (and executes each line immediately) ... whereas a compiler translates the whole code at the same time (before executing it) A compiler produces an executable file ... but an interpreter does not An interpreter is required to run the code each time if used ... whereas a compiler is not An interpreter stops and reports an error as it is encountered ... whereas a compiler creates a report of all errors at the end of translation An interpreter will run code up to the point it finds an error ... whereas a compiler will not run the code at all if an error is found
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →