Edexcel IGCSE Computer Science 4CP0
Algorithms
Searching and Sorting Algorithms
Decomposition and Abstraction
Developing and Testing Code
Programming Constructs and Operators
Data Types and Data Structures
Input, Output and Validation
Data Representation
Data Storage and Compression
Encryption
Hardware and the CPU
Software
Programming Languages and Translators
Networks
Network Security
The Internet and the World Wide Web
Emerging Trends, Issues and Impact
Developing and Testing Code
Types of error
- 3 things to know
- Papers 1 and 2
Overview
Syntax, logic and runtime errors, Python error messages such as NameError and TypeError, and how to locate and fix each.
What you need to know
Answer each one before you reveal it.
What is a syntax error?
What is a logic error?
Questions from this subtopic
Each one with the model answer underneath.
- 1
Name the three types of error in programs.
Model answer
The three types are syntax errors, logic errors and runtime errors.
- 2
What is a syntax error?
Model answer
A syntax error breaks the grammar rules of the programming language, such as a misspelt keyword or a missing bracket. The program cannot be translated.
- 3
What is a logic error?
Model answer
A logic error lets the program run but gives the wrong result, such as using + instead of −.
- 4
What is a runtime error?
Model answer
A runtime error happens while the program is running and makes it crash, such as dividing by zero or opening a file that does not exist.
- 5
Why are logic errors the hardest type of error to find?
Model answer
The program runs without any error message. The programmer must notice that the output is wrong and trace the cause.
- 6
What type of error is the Python line if score > 50 print('Pass'), which has no colon?
Model answer
The line contains a syntax error, because Python requires a colon after an if condition. The program cannot be translated until the colon is added.
Other ways to work this
The same content, four other ways.
Everything in your subscription
Runs, plus a mode for every other kind of session.
Every question in Developing and Testing Code, on a schedule.
Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.