ITPEC IP April 2021 Question 8
Topic: Algorithm and Programming
Among the items A through C described below about programming languages, which of the following is the list that contains all of the appropriate items?
A:A program that is created using a machine language or an assembly language can be executed without relying on a particular CPU.B:A program that is converted using a compiler is finally translated into a machine language and then executed.C:A high-level programming language with rules similar to human languages makes it possible to develop programs with complex calculations that cannot be executed using a machine language.
Explanation
B only — compiled programs end up as machine language, the only form a CPU executes.
- •A is wrong: machine language is the instruction set of a particular CPU, and assembly language is a symbolic form of it, so such programs depend on the CPU
- •B is right: a compiler translates the source program, and the result is finally machine language that the CPU runs
- •C is wrong: a high-level language program is itself translated into machine language to run, so it cannot do a calculation that machine language cannot; it only makes complex programs easier to write
Answer (c)
Why not others:
- •(a) A and (b) A, C — include A, but low-level code is tied to one CPU's instruction set
- •(d) B, C — includes C, but everything a high-level program does is carried out as machine instructions
Key rule: A CPU executes only its own machine language; high-level languages make programs easier to write and to move between CPUs, but they add no computing power.
Algorithm and Programming · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official IP past-paper collection or Report an issue.