Solution: My version can be seen in Exercise1.cpp. It is at the bottom of the page - Please do not look at the solution until you have had a good attempt at the exercise.

The Staff class Exercise

"Within C++, there is a much smaller and cleaner language struggling to get out."

--Bjarne Stroustrup

Task: Update the previous exercise to create a child of thePersonclass, calledStaff. This child class should have the functionality as illustrated inFigure 3.28, “The Person and Staff class hierarchy.”that builds the basic functionality of the general person role in DCU.

Figure 3.28. The Person and Staff class hierarchy.

The output of my version can be seen below, where the addPayRise() method is called to give a pay rise of 5%: