Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started