Test your knowledge with free interactive questions on Seneca — used by over 10 million students.

Types of Errors

Syntax errors

Syntax errors

  • A syntax error is a mistake in the way the code is written.
  • It is similar to a spelling or grammar mistake in English.
  • Syntax errors prevent programs from running as a translator needs code to be syntactically correct.
  • Syntax errors are some of the easier bugs to fix in a broken program.
Examples of syntax errors

Examples of syntax errors

  • prnt("Hello, world!");
    • Incorrect subroutine identifier.
  • newbalance = newBalance * 1.05;
    • Wrong capitalisation in variable identifier.
  • myBoolean = True NOT False;
    • NOT does not take two operands.
Logic errors

Logic errors

  • Logic errors are mistakes in the logic of the program.
  • Programs will run, but their outcome will not be as intended.
  • They are much more difficult to debug than syntax errors.
  • Logic errors are hard to detect because the translator will not detect them for us.
Examples of logic errors

Examples of logic errors

  • Many logic errors arise from the use of the wrong boolean operator, e.g. mixing up AND and OR.
  • Many logic errors arise from putting menu options the wrong way around in a selection statement.
Runtime errors

Runtime errors

  • Runtime errors are errors that happen while the program is running.
  • Runtime errors cannot be found during translation.
  • These errors can only be detected while a program is running.
  • The chance of experiencing a runtime error can be reduced through testing.
  • Runtime errors are the trickiest of the three types of errors because they are not always found during development. Software users may first encounter runtime errors.
Examples of runtime errors

Examples of runtime errors

  • Bad inputs that throw an unhandled exception.
  • Receiving unexpected or corrupted data.
  • Running out of memory.
Jump to other topics
1

Computer Systems

1.1

Systems Architecture

1.2

Memory & Storage

1.3

Computer Networks, Connections & Protocols

1.4

Network Security

1.5

Systems Software

1.6

Ethical, Legal, Cultural & Environmental Concern

2

Computational Thinking, Algorithms & Programming

2.1

Algorithms

2.2

Programming Fundamentals

2.3

Producing Robust Programs

2.4

Boolean Logic

2.5

Programming Languages & IDEs

Practice questions on Types of Errors

Can you answer these? Test yourself with free interactive practice on Seneca — used by over 10 million students.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
Answer all questions on Types of Errors

Unlock your full potential with Seneca Premium

  • Unlimited access to 10,000+ open-ended exam questions

  • Mini-mock exams based on your study history

  • Unlock 800+ premium courses & e-books

Get started with Seneca Premium