IPA FE Subject A sample Question 16

Topic: Software

A question IPA Japan published in 基本情報技術者試験 科目A サンプル問題 問16, translated into English. ITPEC is based on the same exams.

Which of the following is an appropriate description of an interpreter?

Explanation

Executes a source program while interpreting it — an interpreter reads the source statement by statement, analyses each one and runs it at once, producing no object program.

Because nothing is translated in advance, a program can be run as soon as it is written and stopped at the line that fails, which suits development and scripting. The cost is speed: each statement is analysed again every time it is executed, so an interpreted program usually runs slower than a compiled one.

Answer (a)

Why not others:

  • •(b) — translating by inference describes no standard language processor; interpreting means analysing the statements, not reasoning about them
  • •(c) — translating a whole source program into an object program before it runs is what a compiler does
  • •(d) — placing an executable program in main memory so it can run is the job of a loader

Key rule: Compiler: translate first, then run the object program; interpreter: analyse and run one statement at a time; linker: combine modules; loader: put the executable in main memory.

Software · AI-written, may contain errors

This question comes from the past questions IPA Japan publishes, translated into English by ITPEC Practice. ITPEC Practice is an independent study tool and is not affiliated with IPA or ITPEC. See the original paper (PDF) or Report an issue.