INTRODUCTION-TO-IT practice question 12 of 15

Which type of high-level language translates the entire program at once?

Full set: 67 questions

Domain Computer Hardware and Software

Answer options
A: Scripting languages
B: Compiled languages Correct answer
C: Assembly languages
D: Interpreted languages
Correct Answer:
B. Compiled languages
Explanation

Compiled languages use a program called a compiler to translate the entire source code into machine code or an intermediate bytecode before the program is executed. This process, known as compilation, happens all at once, creating a standalone executable file. This file can then be run by the end-user without the original source code or the compiler. This contrasts with interpreted languages, which are translated and executed line-by-line at runtime by an interpreter.

Why Incorrect

A. Scripting languages: These are typically interpreted, meaning they are translated and executed line-by-line, not as a whole program at once.
C. Assembly languages: These are low-level languages, not high-level. They are translated by an assembler, not a compiler in the context of high-level languages.
D. Interpreted languages: These are processed line-by-line by an interpreter during runtime, which is the opposite of translating the entire program at once. ---

References

1. Downey, A. B. (2015). Think Python: How to Think Like a Computer Scientist (2nd ed.). Green Tea Press. In Chapter 1, Section 1.3, "What is a program?", the text distinguishes between interpreters and compilers: "A compiler reads the program and translates it completely before the program starts running... An interpreter reads a high-level program and executes it, meaning that it does what the program says." This confirms that compilers translate the entire program at once.

2. Guttag, J. V. (2016). Introduction to Computation and Programming Using Python: With Application to Understanding Data (2nd ed.). MIT Press. In Chapter 2, Section 2.1, "Objects, Expressions, and Numerical Types," the text explains: "A compiler first translates the entire program into a lower-level language... An interpreter, on the other hand, processes the program a little bit at a time." This directly supports the distinction.

3. Brookshear, J. G., & Brylow, D. (2015). Computer Science: An Overview (12th ed.). Pearson. In Chapter 6, Section 6.2, "Program Translation," the text defines a compiler as a tool that "produces a machine-language version of the entire program that can be executed at a later time."

Scroll to Top