WorksheetsFOP - CHAPTER 4
Total questions: 20
Worksheet time: 10mins
What type of error occurs when the code violates the grammatical rules of C++?
Runtime Error
Syntax Error
Which error occurs during the execution of a program due to illegal operations?
Runtime Error
Linker Error
What is the purpose of the try block in C++ exception handling?
To enclose code that may throw an exception
To define error messages
Which of the following is NOT a type of error mentioned in the text?
Syntax Error
Compile Error
What does the catch block do in C++?
It throws exceptions
It handles exceptions
What is a logic error?
An error in the algorithm leading to incorrect output
An error related to linking libraries
What is the main advantage of exception handling over traditional error handling?
It separates error handling code from normal code
It mixes error handling with normal code
What happens if an exception is thrown and not caught in C++?
The program terminates abnormally
The program enters an infinite loop
Which keyword is used to throw an exception in C++?
try
throw
What is the purpose of debugging?
To find and fix errors in the source code
To write new code
What is a synchronous exception?
An exception that occurs due to system failures
An exception that occurs due to user input errors
Divide by zero and square root of a negative number are the examples of _____.
Linker Errors
Runtime Errors
What does the term 'hand tracing' refer to in debugging?
Simulating program execution step by step
Writing code by hand
What is a catch-all block in C++?
A block that catches all exceptions
A block that throws exceptions
Misspelled keyword, misplace the punctuation and undeclared variables are the examples of _____.
Syntax Errors
Runtime Errors
The process of finding and fixing errors or bugs in the source code of any software are known as _____
Debugging
Compiling
Error identification, Error analysis and Fix and validation are the steps in _____.
Runtime process
Debugging process
_____ ensures that changes do not uncover new bugs, for example by causing unit tests to fail in an unrelated component.
Regression test
Unit tests
The program contains a defect in the source code , either due to a design misunderstanding or an implementation mistake.
Bug
Rug
What are the 2 main types of errors that need debugging?
Syntax time & Logic time
Compile time & Run time
