Recall & Review
beginner
What is a runtime error?
A runtime error is a problem that occurs while a program is running, causing it to stop or behave unexpectedly. It happens after the program has successfully compiled.
Click to reveal answer
beginner
Why is runtime error handling important?
Runtime error handling helps programs detect and manage errors during execution, preventing crashes and allowing the program to respond gracefully or recover.
Click to reveal answer
beginner
Name two common types of runtime errors.
Two common runtime errors are division by zero and accessing invalid memory (like null pointer errors).
Click to reveal answer
intermediate
How does a runtime error handler work in a program?
A runtime error handler detects errors during program execution, then takes actions like showing error messages, stopping the program safely, or trying to fix the problem.
Click to reveal answer
beginner
What is the difference between compile-time errors and runtime errors?
Compile-time errors are found by the compiler before running the program, like syntax mistakes. Runtime errors happen while the program runs, like dividing by zero.
Click to reveal answer
When do runtime errors occur?
✗ Incorrect
Runtime errors happen during the execution of the program, not before or after.
Which of the following is an example of a runtime error?
✗ Incorrect
Division by zero is a runtime error because it happens when the program runs.
What is the main goal of runtime error handling?
✗ Incorrect
Runtime error handling manages errors that occur while the program is running.
Which of these is NOT a runtime error?
✗ Incorrect
Syntax errors are compile-time errors, not runtime errors.
How can a program respond to a runtime error?
✗ Incorrect
Programs usually show an error message and stop safely or try to recover when a runtime error occurs.
Explain what runtime error handling is and why it is necessary in programs.
Think about what happens when a program encounters a problem while running.
You got /3 concepts.
Describe the difference between compile-time errors and runtime errors with examples.
Consider when the error is found: before running or during running the program.
You got /4 concepts.