Develop code Flashcards
1
Q
Give three types of errors that could occur within a program.
A
- Syntax
- Logic
- Runtime
2
Q
What is a syntax error?
A
An error that occurs when the rules of the programming language are not followed (e.g. command word is mispelled, punctuation is incorrect, variable is used without being initialised)
3
Q
What is a logic error?
A
An error that occurs when there is a flaw in the design of a program, which does not prevent it from running but produces an incorrect or unexpected result
4
Q
What is a runtime error?
A
An error that occurs during program execution when the processor is asked to perform an impossible operation (e.g. divide by zero, open a non-existent file)
5
Q
State the purpose of a trace table.
A
- To allow the value of a variable, outputs and decisions in certain points throughout the algorithm to be recorded
- To help detect logic errors in the program