Download presentation
Presentation is loading. Please wait.
Published byBendik Bakken Modified over 5 years ago
1
Learning Intention I will learn about the different types of programming errors.
2
Analysis Design Implementation Testing Documentation Evaluation
3
Types of Error There are three types of error which can occur when you are creating programs: syntax execution logic
4
Syntax Errors Syntax errors are sometimes caused by typing mistakes
e.g.
5
Syntax Errors Syntax errors prevent the program from running.
6
Syntax Errors Syntax errors are sometimes caused by not knowing the syntax (rules) of the programming language e.g.
7
Execution Errors Execution errors only show up when the program is running and cause it to crash e.g. divide by zero – dividing a number by 0 gives the answer infinity (∞)which the computer cannot store opening file that does not exist
8
Execution Errors Here is an example of code that attempts to divide by zero. Line 1 RECEIVE number1 FROM KEYBOARD Line 2 SET number2 TO number1 / 0 Line 3 SEND number2 TO DISPLAY
9
Logic Errors Logic errors cause the program to operate incorrectly but not crash. The program will run but the output will be wrong. e.g. adding two numbers instead of subtracting using < instead of <= in a condition (If)
10
Logic Errors The following program runs but the output will not match what is expected. Line 1 RECEIVE number1 FROM KEYBOARD Line 2 RECEIVE number2 FROM KEYBOARD Line 3 SET average TO (number1 + number2) / 2 Line 4 SEND average TO DISPLAY Which line has the logic error?
11
Success Criteria I can describe and identify the different types of error in a program.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.