Classification of programming languages and translators

EasyMedium
12345678910111213141516171819202122232425262728293031323334
Question 24
Easy

The Python program shown below contains an error.

1  readings = [14.2, 15.8, 16.0, 18.0]
2  total = 0
3  for value in readings:
4      total = total + value
5  average = total / 3
6  print("Average:", average)

Select the two statements that are correct about logic errors and code translators.

  • A: A logic error is a violation of the grammatical rules of the programming language and will prevent translation.
  • B: An example of a logic error is dividing by an incorrect constant (as on line 5), which produces an incorrect result rather than an execution crash.
  • C: A compiler or interpreter cannot automatically detect logic errors during translation because the code conforms to the language's syntax rules.
  • D: An interpreter will halt program execution and display a specific line-numbered error message when a logic error is encountered.
  • E: Logic errors are generally easier to find than syntax errors because translators are specifically designed to locate incorrect mathematical formulas.
[2]

Classification of programming languages and translators Questions

  1. GCSE
  2. /Computer Science
  3. /Classification of programming languages and translators