47. Which translation method converts all source code into machine code for later execution?
Answer: B
Compiler
The compiler is the translation method that converts all source code into machine code for later execution. This process allows the entire program to be compiled and then executed multiple times without the need for re-translation.
A) Interpreter
An interpreter translates source code into machine code line-by-line at runtime. Unlike a compiler, it does not produce a complete machine code file for later execution, which is why it is not the correct choice for this question.
B) Compiler
The compiler translates the entire source code into machine code before execution, allowing the program to be run multiple times without re-translation. This method is efficient for execution and is the correct answer to the question.
C) Operating system
The operating system is not a translation method. Instead, it is software that manages hardware and software resources on a computer. It does not convert source code into machine code, thus making it an incorrect option in this context.
D) Assembler
An assembler translates assembly language code into machine code. While it does convert source code into machine code, it is specific to assembly language rather than high-level programming languages, making it unsuitable as an answer for this particular question.
Conclusion
The compiler is definitively the correct answer as it fully converts source code into machine code for subsequent execution. All other options either do not perform this specific function or are not relevant to high-level language translation, reinforcing the unique role of the compiler in software development.