Group 1 Exercises

Please try individually to fill in the blanks and answer the True or False in the questions of the second exercise. You should also be able to justify your answer.

Exercise 1:

Fill in the blanks in each of the following statements: 

a) Treating a base-class object as a(n) ___________ can cause errors. 

b) Polymorphism helps eliminate ___________ logic. 

c) If a class contains at least one pure virtual function, it’s a(n) ____________ class. 

d) Classes from which objects can be instantiated are called ______________ classes. 

e) The destructors of any derived classes are also virtual if _______________ destructor is declared virtual. 

f) Constructors cannot be declared ________________

g) Dynamic binding with virtual functions occurs only off ________________ and ______________

h) Overridable functions are declared using keyword ________________

i) To call a function appropriately at execution time is known as ______________ .


Exercise 2:

State whether each of the following is true or false. If false, explain why. 

a) Polymorphism enables “programming in the specific.” 

b) With polymorphism, one function call can cause different actions to occur. 

c) Polymorphism is implemented only via dynamic binding. 

d) After the derived-class destructor runs, the destructors for all of that class’s base classes run all the way up the hierarchy. 

e) Objects of an abstract class may be instantiated. (Deitel)


Exercises have been taken from:

Deitel, Paul. C++ How to Program (Early Objects Version), Global Edition, 10th Edition. Pearson (Intl), 20170831.

Last modified: Monday, 3 December 2018, 2:22 AM