23. Which translation method converts all source code into machine code for later execution?

Answer: D

Explanation:

Compiler converts all source code into machine code for later execution.

A compiler translates the entire source code of a program into machine code, allowing it to be executed at a later time without the need for the original source code.

A) Interpreter

An interpreter translates source code into machine code line-by-line during execution. Unlike a compiler, it does not convert the entire program into machine code for later use, meaning that the source code must be present each time the program runs.

B) Operating system

An operating system is not a translation method; rather, it is software that manages computer hardware and software resources. It does not convert source code into machine code, so it is not relevant to this question.

C) Assembler

An assembler translates assembly language into machine code, but it does not handle high-level programming languages. While it does convert code into machine code, it is not the method that applies to all source code, which is what the question specifically asks for.

D) Compiler

A compiler is the correct method as it converts all source code from high-level programming languages into machine code in one complete process, which can then be executed later. This creates an executable file that can run independently of the original source code.

Conclusion

The compiler is the definitive answer as it uniquely fulfills the requirement of converting all source code into machine code for future execution. Other options like the interpreter, operating system, and assembler do not meet this criterion, leaving the compiler as the only suitable choice for this function.