Practice Programs
Practice Programs can generally be solved with a short program that directly applies the programming principles presented in this chapter.
Define a class named
Employeewhose objects are records for employees. Derive this class from the classPersongiven in Listing 8.1. An employee record inherits an employee’s name from the classPerson. In addition, an employee record contains an annual salary represented as a single value of typedouble, a hire date that gives the year hired as a single value of typeint, and an identification number that is a value of typeString. Give your class a reasonable complement of constructors, accessor methods, and mutator methods, as well as anequalsmethod. Write a program to fully test ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access