Home Segments Top Top Previous Next

327: Practice

Design a class hierarchy for a dozen occupations. At the highest level, place an instance variable named yearsOfExperience and locationMultiplier. Write an instance method, estimatedSalary, for the classes in your hierarchy. Include classes such as Physician, Lawyer, Engineer, Athlete, Ornithologist, Astrologer, and Editor.