Question
i need help in this CS 162 Assignment 08 (operator overloading + review of this keyword + friend as well as the -> operator )
i need help in this CS 162 Assignment 08 (operator overloading + review of this keyword + friend as well as the -> operator ) Date: Nov 18 2020
For the current weeks assignment, you will do the following: Review the programs (ceo.h and ceo_impl.cpp and ceo_driver.cpp) shown below. Complete the sections outlined in red in the ceo_driver.cpp file:
ceo.h #include
class ceo{
friend ceo update_ceo (ceo);
private: string ceo_name; string company_name; int job_duration;
public: ceo(){}; ceo(string, string, int);
bool operator==(ceo);
}; ceo_impl.cpp #include
ceo::ceo(string cname, string cmp_nm, int cduration){ ceo_name = cname; company_name = cmp_nm; job_duration = cduration; }
bool ceo::operator==(ceo c){ Complete the function body }
ceo_driver.cpp #include
void compare_ceos(ceo current, ceo past){ // Complete the function body }
int main(){
ceo current_ceo("Otellini", "Intel", 10); ceo past_ceo("Bryant","Intel", 25); compare(current_ceo, past_ceo); return 0;
}
Sample Output: ############### These are two different CEO's ###############
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