c++ programming questions, most points to most complete! 1. The block of code th
ID: 3771778 • Letter: C
Question
c++ programming questions, most points to most complete!
1. The block of code that checks if an unusual situation or error occurs is called (Points : 2)
the try block
the catch block
a function
an error block
Question 2.2. When an unusual situation or error occurs, then the ________ statement is executed. (Points : 2)
try
throw
error
exiting
Question 3.3. Which type of exception is thrown if a call to the new operator fails? (Points : 2)
ArithmeticError
DivideByZero
bad_alloc
MemoryError
Question 4.4. You should use exception handling (Points : 2)
in all your programs
only when you can not handle the exception with simpler control structures
only when you use classes
in every function
Question 5.5. Which is the correct way to tell the compiler that the class being declared (ChildClass) is derived from the base class (BaseClass)? (Points : 2)
class ChildClass::public BaseClass
class ChildClass:public BaseClass
class ChildClass childOf public BaseClass
class ChildClass derived BaseClass
Question 6.6. If the member variables in a base class are private, then (Points : 2)
they can be directly accessed or changed in the derived class
the derived class must use any accesssor or modifier functions from the base class
making them private causes a syntax error.
you must declare them in the derived class also.
Question 7.7. Using inheritance allows us to (Points : 2)
eliminate duplicate code
make our classes more modular
use polymorphism
all of the above
none of the above
Explanation / Answer
1. A) the try block
2. B) throw
3. C) bad_aclloc
4. A) only when you cannot handle the exception with simpler control structures.
5. B) class ChildClass:public BaseClass
6. B) The derived class must use any accesssor or modifier functions from the base class
7. C) all of the above
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.