Lesson 4.6.3.1
4.6.3.1 Types of program translator Quiz: AQA Computer Science, Unit 6
20 questions
In partnership with Revision Ninja
Lesson 4.6.3.1, Types of program translator: 20 multiple choice questions for the AQA Computer Science (7517), Unit 6: Fundamentals of computer systems, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
Which translator converts assembly language into machine code?
- A compiler
- An interpreter
- A linker that combines object files into a library
- An assembler
-
Which statement correctly describes a compiler?
- It stores the source code of a program in memory so that the processor can read it directly
- It translates a whole high-level program into object code before the program is run
- It converts assembly mnemonics one-to-one into binary opcodes for the processor
- It translates and runs each statement of a high-level program one at a time during execution
-
Which statement describes an interpreter?
- It translates the complete source code into object code before any statement runs
- It translates and executes a program statement by statement, without producing a separate executable file
- It converts assembly language into machine code without executing any of the statements
- It stores the source code of the program so that it can be run again without translation
-
What is a key difference between compilation and interpretation?
- Compilation can only be used with assembly language, whereas interpretation is used for all high-level code
- Compilation produces object code that can be run later, whereas interpretation translates and runs the source as it goes
- Compilation runs the source line by line, whereas interpretation always produces a final executable
- Compilation is always faster to start, whereas interpretation is always slower to start than a compiled program
-
Which situation would most suit using an interpreter rather than a compiler?
- Writing a device driver where every instruction must be placed at a fixed address in memory
- Developing and testing a program, where the programmer wants to run and correct each change quickly
- Producing an embedded control program that must run from read-only memory with no source present
- Distributing a finished game where the fastest possible execution on the user's machine matters most
-
Which situation would most suit using a compiler rather than an interpreter?
- Testing a new function line by line to see how each statement changes the values of variables
- Distributing a finished program that must run quickly on many users' machines without the source code
- Checking the output of a single expression in an interactive session with immediate feedback
- Experimenting with short scripts that change frequently during an afternoon of learning
-
What is the difference between source code and object code?
- Source code and object code are identical, but object code is always stored in main memory
- Source code is written by the programmer, while object code is the machine-readable output of translation
- Source code is produced by an interpreter, while object code is produced by an assembler only
- Source code is machine-readable binary, while object code is the text typed by the programmer
-
Why does some compiler output consist of bytecode rather than machine code?
- Bytecode is the only form in which an assembler can produce a program that uses registers
- Bytecode is an intermediate form that can be run on any machine with a suitable virtual machine
- Bytecode is faster for the processor to run than machine code because it skips the fetch stage
- Bytecode is used because it requires no translation step at all and is stored directly in the ROM
-
A compiler produces bytecode for a program. What must happen before the program can run on a particular computer?
- The bytecode must be converted into source code by a decompiler before it can be read
- The bytecode must be stored in the status register so that the processor can fetch it
- The bytecode must be assembled into a separate instruction set for the computer's registers
- A virtual machine or interpreter for that platform must execute the bytecode
-
Which translator would produce the most efficient executable for a program that will run repeatedly on one fixed machine?
- An interpreter, since it translates each statement afresh on every run for maximum efficiency
- An assembler, since it translates high-level code directly into object code with no overheads
- A text editor, since it stores the program in a form that the processor executes without changes
- A compiler, since it translates the whole program once and the object code runs without further translation
-
Which statement about object code is correct?
- Object code is the high-level source typed by the programmer and kept for later editing
- Object code is produced by the operating system when a program is closed by the user
- Object code is the executable form that a processor can run, usually in binary
- Object code is the same as source code but with comments removed from every line
-
A developer runs the same program in an interpreter and then as a compiled executable. Which outcome is most likely?
- The interpreted version starts more quickly, but the executable cannot be edited at all afterwards
- The executable produces different results because compilation always removes arithmetic operations
- The compiled executable starts running more quickly, while the interpreted version is easier to change
- Both versions take exactly the same time to run, because translation is identical in both cases
-
Which translator reads and checks an entire source program and reports errors before creating object code?
- A compiler
- A bytecode virtual machine, which only executes the program once it has started
- An interpreter, which reports the error at the first statement it executes
- An assembler, which ignores any high-level syntax errors it finds
-
Which statement about intermediate languages such as bytecode is correct?
- They are used only by assemblers and never by compilers or interpreters in modern systems
- They are a form of machine code specific to one processor family and cannot be run elsewhere
- They remove the need for any translation at all, so the source code is executed directly on the chip
- They allow one compiled form to be used across different platforms that provide a suitable virtual machine
-
A student writes a short program to print the first ten squares and wants instant feedback after every edit. Which translator is most appropriate for this stage?
- An assembler, because it converts the program directly into the student's chosen high-level language
- A linker, because it combines the program with the operating system's libraries before running
- An interpreter, because it runs each statement as it is reached and reports errors immediately
- A compiler, because it runs the whole program in a single pass with no reporting of errors
-
What is the main output of an assembler?
- A list of error messages only, with no executable code produced at any stage
- Machine code corresponding to the assembly mnemonics in the source program
- A bytecode file that must be run inside a virtual machine on each computer
- A high-level source file that a compiler will later process into object code
-
Which statement about how an interpreter reports errors is correct?
- Errors are found only after the object file has been linked into a library file
- Errors are never reported because an interpreter corrects them automatically as it runs
- An error in a statement is found only when execution reaches that statement
- All errors in the whole program are reported before the first statement is ever executed
-
Which is true of a program that has been compiled successfully?
- It can run only on the machine that holds the source file it was compiled from
- It must be interpreted line by line on every run before any output is produced
- Its source code must be present on the computer for every single run of the program
- Its object code can be executed without the original compiler being present
-
A compiled program's object code is 2 MB and its source is 40 KB. Which statement is most accurate?
- Object code can be far larger than source, because each high-level statement expands into many machine instructions
- Object code and source code always have identical sizes because they describe the same program
- Object code is always smaller than source code, because it is stored in binary form
- Object code must be stored inside the source file, which is why the source file is larger
-
A program takes an interpreter 0.1 s to begin and a compiler 2 s to translate it before running. Which translator starts the program's first output sooner?
- The compiler, since it translates only the first line before starting the program
- The interpreter, since it translates and runs statements as it reaches them
- Both start at exactly the same moment because the source is read in a single pass
- The interpreter, since it translates the whole program before the first output appears
Related quizzes
- Data types Quiz · 4.1.1.1 · 20 questions
- Entity relationship modelling Quiz · 4.10.1.1 · 20 questions
- Big Data Quiz · 4.11.1.1 · 20 questions
- Function types and first-class objects Quiz · 4.12.1.1 · 20 questions
- Analysis Quiz · 4.13.1.1 · 20 questions
- Data structures and abstract data types Quiz · 4.2.1.1 · 20 questions
- Breadth-first and depth-first search Quiz · 4.3.1.1 · 20 questions
- Problem-solving and algorithms Quiz · 4.4.1.1 · 20 questions
- Natural, rational, irrational and real numbers Quiz · 4.5.1.1 · 20 questions
- Programming concepts: sequence, selection and iteration Quiz · 4.1.1.2 · 20 questions