Home Segments Index Top Previous Next

261: Practice

Design a class hierarchy for a dozen occupations. At the highest level, place a member variable named years_of_experience and location_multiplier. Write a member function, estimated_salary, for various classes in your hierarchy. Include classes such as physician, lawyer, engineer, and sports_hero.