Object Oriented Programming Using C++ – Section 1

1. You can use C++ as a procedural, as well as an object-oriented, language

A. True
B. False

Correct Answer:  A. True
Advertisement

2. A default catch block catches

A. all thrown objects
B. no thrown objects
C. any thrown object that has not been caught by an earlier catch block
D. all thrown objects that have been caught by an earlier catch block

Correct Answer:  C. any thrown object that has not been caught by an earlier catch block
Advertisement

3. Adding a derived class to a base class requires fundamental changes to the base class

A. True
B. False

Correct Answer:  B. False
Advertisement

4. Format flags may be combined using

A. the bitwise OR operator (|)
B. the logical OR operator (||)
C. the bitwise AND operator (&)
D. the logical AND operator (&&)

Correct Answer:  A. the bitwise OR operator (|)
Advertisement

5. The use of the break statement in a switch statement is

A. optional
B. compulsory
C. not allowed. It gives an error message
D. to check an error
E. None of the above

Correct Answer:  A. optional
Advertisement

Leave A Comment?