Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 using namespace std;

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 using namespace std; #include "ceo.h"

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 #include #include using namespace std; #include "ceo.h"

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

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago