Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

FOP - CHAPTER 4

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What type of error occurs when the code violates the grammatical rules of C++?

a)

Runtime Error

b)

Syntax Error

2.

Which error occurs during the execution of a program due to illegal operations?

a)

Runtime Error

b)

Linker Error

3.

What is the purpose of the try block in C++ exception handling?

a)

To enclose code that may throw an exception

b)

To define error messages

4.

Which of the following is NOT a type of error mentioned in the text?

a)

Syntax Error

b)

Compile Error

5.

What does the catch block do in C++?

a)

It throws exceptions

b)

It handles exceptions

6.

What is a logic error?

a)

An error in the algorithm leading to incorrect output

b)

An error related to linking libraries

7.

What is the main advantage of exception handling over traditional error handling?

a)

It separates error handling code from normal code

b)

It mixes error handling with normal code

8.

What happens if an exception is thrown and not caught in C++?

a)

The program terminates abnormally

b)

The program enters an infinite loop

9.

Which keyword is used to throw an exception in C++?

a)

try

b)

throw

10.

What is the purpose of debugging?

a)

To find and fix errors in the source code

b)

To write new code

11.

What is a synchronous exception?

a)

An exception that occurs due to system failures

b)

An exception that occurs due to user input errors

12.

Divide by zero and square root of a negative number are the examples of _____.

a)

Linker Errors

b)

Runtime Errors

13.

What does the term 'hand tracing' refer to in debugging?

a)

Simulating program execution step by step

b)

Writing code by hand

14.

What is a catch-all block in C++?

a)

A block that catches all exceptions

b)

A block that throws exceptions

15.

Misspelled keyword, misplace the punctuation and undeclared variables are the examples of _____.

a)

Syntax Errors

b)

Runtime Errors

16.

The process of finding and fixing errors or bugs in the source code of any software are known as _____

a)

Debugging

b)

Compiling

17.

Error identification, Error analysis and Fix and validation are the steps in _____.

a)

Runtime process

b)

Debugging process

18.

_____ ensures that changes do not uncover new bugs, for example by causing unit tests to fail in an unrelated component.

a)

Regression test

b)

Unit tests

19.

The program contains a defect in the source code , either due to a design misunderstanding or an implementation mistake.

a)

Bug

b)

Rug

20.

What are the 2 main types of errors that need debugging?

a)

Syntax time & Logic time

b)

Compile time & Run time