Question: Refer to the previous answer from this post (https://www.chegg.com/homework-help/questions-and-answers/c-class-constructs-inheritance--create-date-class-attributes-month-day-year-b-create-emplo-q43962687). Write the code in c++ (separate it to header and cpp file) and please elaborate with
Refer to the previous answer from this post (https://www.chegg.com/homework-help/questions-and-answers/c-class-constructs-inheritance--create-date-class-attributes-month-day-year-b-create-emplo-q43962687).
Write the code in c++ (separate it to header and cpp file) and please elaborate with comments.
Thank you so much for your help!
1. Write and test a friend function that checks to see if the phone number of a C1SCEmployee object is equal to the phone number of a Programmer object. Test equal and not equal scenarios. (You will need to call your ChangePhoneNumber method) 2. Overload the equality operator to see if the phone number of two C1SCEmployees are the same. Test equal and not equal scenarios. (You will need to call your ChangePhoneNumber method) 3. Write an addition member function that adds an integer to a CS1Cemployee's age (make sure the integer is a passed parameter). The output should state how many years were added to the age. 4. Overload the addition operator to add a constant to a CS1Cemployee's age. For example: StarC1SCEmployee = StarC1SCEmployee +2. The output should state how many years were added to the age. 5. Overload and operators to read in a CS1Cemployee object (e.g. cin myEmployee and cout myEmployee)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
