Employee is a base class and HourlyWorker is a derived class, with a redefined non-virtual print function. Given the following statements, will the output of the two print function calls be identical?

HourlyWorker h;
Employee *ePtr = &h;


ePtr->print();
ePtr->Employee::print();

a. Yes.
b. Yes, if print is a static function.
c. No.
d. It would depend on the implementation of the print function.


a. Yes.

Computer Science & Information Technology

You might also like to view...

Charlotte is learning about fair use of copyrighted material. Charlotte learns that taking audio tracks from a CD and converting them into MP3 format is called ____ shifting.

A. shape B. time C. place D. format

Computer Science & Information Technology

Draw an inheritance hierarchy for students at a university similar to the hierarchy shown in Fig. 12.2. Use Student as the base class of the hierarchy, then include classes UndergraduateStudent and GraduateStudent that derive from Student. Continue to extend the hierarchy as deep (i.e., as many levels) as possible. For example, Freshman, Sophomore, Junior and Senior might derive from

UndergraduateStudent, and DoctoralStudent and MastersStudent might derive from Graduate-Student. After drawing the hierarchy, discuss the relationships that exist between the classes. What will be an ideal response?

Computer Science & Information Technology

Word templates are saved with the .dotx extension

Indicate whether the statement is true or false

Computer Science & Information Technology

In project management, the terms "goal" and "objective" are used interchangeably.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology