Difficulty: Easy
Correct Answer: A program written in a high-level or assembly language that is to be translated into machine language
Explanation:
Introduction / Context:
When software is developed, programmers usually write instructions in a high-level language such as C, Java or Python, or in assembly language. Computers, however, can only execute instructions in machine language, which is a sequence of binary codes. The term source program refers to the human readable version written by the programmer before it is translated into machine code. This question checks whether you can correctly identify what a source program is in comparison with machine language and object code.
Given Data / Assumptions:
Concept / Approach:
A source program is the original version of the program written by the programmer in a high-level language or assembly language. It is usually stored in text files and can be read and modified by humans. This source program is then processed by a compiler or assembler to produce an object program or machine language version that the CPU can execute. Once translated, the resulting binary is no longer called source; it is object code or executable code. Therefore, the correct definition emphasises that a source program is to be translated into machine language, not that it is already in machine language.
Step-by-Step Solution:
Verification / Alternative check:
Textbooks on compilers and programming repeatedly use the term source program for the original code supplied by the programmer and object program for the translated machine code. Development tools label files with extensions such as .c, .java or .asm as source files. Documentation for compilers explicitly refers to reading source code and producing executable or object files. None of these references call the machine language version a source program. This clear and consistent terminology across programming resources confirms that the correct answer is the high-level or assembly program awaiting translation.
Why Other Options Are Wrong:
Common Pitfalls:
Some beginners confuse the words program and code and think there is no difference between source and machine code. Others may misread the question and pick all of the above because they associate program with any type of code. To avoid this, always remember that source is what the programmer writes and reads, while machine code is what the CPU executes. The translation step in between is the job of the compiler or assembler. Keeping this pipeline in mind makes the definition of source program easy to recall.
Final Answer:
A source program is a program written in a high-level or assembly language that is to be translated into machine language by a compiler or assembler.
Discussion & Comments