Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedRefer 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

In what activities do you participate?

Answered: 1 week ago

Question

Refer to the previous answer from this post...

Answered: 1 week ago