Types of error that may occur in programming code
Error Description Example
An error that occurs when a command does not follow
Incorrect: IF A ADN B Then
Syntax the expected syntax of the language, e.g. when a
Correct: IF A AND B Then
keyword is incorrectly spelt
An error that only occurs when the program is running Program requests more
Runtime/ memory when none is
and is difficult to foresee before a program is compiled
execution available, so the program
and run
crashes
An algorithm that calculates
An error that causes a program to output an incorrect a person’s age from their
Logical
answer (that does not necessarily crash the program) date of birth, but ends up
giving negative numbers
When the square root
An error that occurs when a programmer calls a function function is used and the
Linking within a program and the correct library has not been library that calculates the
linked to that program square root has not been
linked to the program
Rounding is when a number is approximated to nearest 34.5 rounded to nearest
Rounding whole number is 35, an
whole number/tenth/hundredth, etc.
error of +0.5
Truncating is when a number is approximated to a whole 34.9 truncated to whole
Truncation number is 34, an error of
number/tenth/hundredth, etc. nearer zero
-0.9
INTERESTING FACT
In 1947, Grace Murray Hopper, an admiral in
the U. S. Navy and a computer programming
pioneer, documented the first actual computer
bug when a moth got trapped in a computer.