Prepare for the A Level Computer Science OCR Exam with engaging quizzes, detailed explanations, and effective study tips. Maximize your readiness and boost your confidence for exam day!

Practice this question and more.


Which characteristic applies to an interpreter?

  1. It compiles code into an executable file

  2. It translates high-level language into machine code line-by-line

  3. It requires pre-compilation of all code

  4. It generates a symbol table for the entire program

The correct answer is: It translates high-level language into machine code line-by-line

The characteristic that applies to an interpreter is that it translates high-level language into machine code line-by-line. This means that an interpreter reads and executes the code one instruction at a time, translating it directly into machine code that the computer can execute immediately. This approach allows for immediate feedback and error detection, as any issues in the code can be identified as they occur during execution rather than at the end of a compilation process. Compiling code into an executable file is a process associated with compilers rather than interpreters. Compilers translate the entire source code into machine code before execution, creating a separate executable file that can be run independently. Requiring pre-compilation of all code is also a characteristic of compilers, not interpreters. Interpreters do not need to compile the entire program before execution; they process each line as it is encountered. Generating a symbol table for the entire program is typically part of the compilation process. A symbol table is used to keep track of variables and their attributes, and while interpreters may use symbol tables, they do not necessarily generate one for the entire program as part of their execution method, since they can operate without compiling the entire program at once. Therefore, the correct option highlights the interpreter's key function of