Description
For this lab, you will write the header files and implementation files for 2 classes, which are to be used in the small program that I have provided. The header files must have #ifndef statements, and all the files should be appropriately commented.
The details about the classes are as follows:
- personType
- 2 private member variables to hold the first and last name of a person
- 4 public member functions:
- print – a constant function to print the name of the person
- setName – sets the first and last name according to the parameters
- getFirst – constant function which returns the first name
- getLast – constant function which returns the last name
- 1 constructor which sets both the member variables to the empty string if no parameters are provided, otherwise uses the provided information
- partTimeEmployee : a public derivation of a personType
- 2 private member variables to hold the payRate and the hoursWorked
- 3 public member functions
- print – a constant function to print the last name, first name, and wages for an employee.
- calculatePay – a constant function which returns the wages for an employee, based on the payRate and hoursWorked.
- setInfo – Function to set the first name, last name, payRate, and hoursWorked according to the parameters.
- 1 Constructor with parameters – Sets the first name, last name, payRate, and hoursWorked according to the parameters. If no value is specified, default values of empty strings and the value 0.0 are used for the appropriate variables.