0% found this document useful (0 votes)
5 views1 page

Programming Errors 2

The document outlines various types of programming errors, including syntax errors, runtime/execution errors, logical errors, and linking errors, each with descriptions and examples. It also explains rounding and truncation errors, highlighting how they affect numerical approximations. Additionally, it includes an interesting fact about Grace Murray Hopper documenting the first computer bug in 1947.

Uploaded by

emanuelaakalo70
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Programming Errors 2

The document outlines various types of programming errors, including syntax errors, runtime/execution errors, logical errors, and linking errors, each with descriptions and examples. It also explains rounding and truncation errors, highlighting how they affect numerical approximations. Additionally, it includes an interesting fact about Grace Murray Hopper documenting the first computer bug in 1947.

Uploaded by

emanuelaakalo70
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like