Robust and secure programming

EasyMediumHard
123456789101112131415161718
Question 11
Easy

The program shown below contains errors.

1  scores = [85, 90, 78, 92]
2  total = 0
3  for i in range(len(scores))
4      total = total + scores[i]
5  average = total / 5
6  print("Average is: " + average)

Which statement is true about syntax errors?

A syntax error is caused by a violation of the programming language's rules or grammar.

A syntax error can easily be identified by dry-running the algorithm with a trace table.

A syntax error occurs when the program runs fully but produces an unexpected or incorrect output.

Dividing a number by zero during program execution is a typical example of a syntax error.

Robust and secure programming Questions

  1. GCSE
  2. /Computer Science
  3. /Robust and secure programming