Please enable JavaScript.
Coggle requires JavaScript to display documents.
Types of Errors (Syntax Error (Examples (Using variables without…
Types of Errors
Syntax Error
What causes it
Code does not follow rules of normal programming language
Usually detected during development
Program will not be compiled
Examples
Using variables without declaration
Spelling errors
Passing incorrect/insufficient parameters
Missing parts of multiline statements
Data type mismatch
Missing/extra brackets
Logic Error
What causes it
Syntax of code is correct but doesn't do what it should
Runs normally with unexpected results
Detected while testing
May cause run-time error
Examples
Incorrect mathematical formulae
Misplaced brackets
Instructions written, and therefore executed, in wrong order
Incorrect conditions provided for loops/ selection statements
Run-time Error
What causes it
Program attempts impossible operation
Causes program to crash at run-time
Usually detected at run-time
Examples
Division by zero
Attempts to access non-existent file
Attempts to reference array elements before they are initialised
Finding a √ of a negative number
Overflow error from a calculation that is too large