10. What translates and executes source code into machine language one line at a time?

Answer: C

Explanation:

Interpreter translates and executes source code into machine language one line at a time.

An interpreter directly translates and executes code one line at a time, allowing for immediate execution of programming instructions. This contrasts with other options that either perform different functions or operate in a different manner.

A) Operating system

An operating system is responsible for managing computer hardware and software resources, and providing common services for computer programs. It does not translate or execute programming code; rather, it facilitates the execution environment for programs, making this option incorrect.

B) Assembler

An assembler is a tool that converts assembly language, which is a low-level programming language, into machine code. While it translates code, it does so for a specific type of programming language and does not operate line by line in the same manner as an interpreter, making this option incorrect.

C) Interpreter

An interpreter translates and executes source code into machine language one line at a time, which is precisely what the question describes. This allows for immediate execution and debugging of programs, making this the correct choice.

D) Compiler

A compiler translates the entire source code of a program into machine code before execution, which means it does not execute line by line. This batch processing approach is fundamentally different from the operation of an interpreter, rendering this option incorrect.

Conclusion

The interpreter is the only option that accurately describes the process of translating and executing source code line by line. The other options either perform different functions or do not align with the specific operation of an interpreter, confirming that Option C is definitively correct.