Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IMC_Inheritance: Athletes and Soccerplayers Requested files: soccer_player.cpp, soccer_player.h (Download) Type of work: Individual work The class Soccer Player inherits from the class Athlete (public inheritance)
IMC_Inheritance: Athletes and Soccerplayers Requested files: soccer_player.cpp, soccer_player.h (Download) Type of work: Individual work The class Soccer Player inherits from the class Athlete (public inheritance) as shown below: #include #include class Athlete { public: Athlete(const std::string& name_ref, const std::string& club_ref, int age, bool active) { name_ = name_ref; club_ = club_ref; age_ = age; active_ = active; }; std::string name() const { return name_; }; std::string club() const { return club_; }; bool active() const { return active_; }; int age() const { return age_; }; void set_name(const std::string& name_ref) { name_ = name_ref; }; void set_club(const std::string& club_ref) { club_ = club_ref; }; void set_age(int age) { age_ - age; }; void set_active(bool active) { active_ = active; }; private: std::string name_; int age_; std::string club_; bool active_; }; class SoccerPlayer : public Athlete { public: SoccerPlayer(const std::string& name_ref, const std::string& club_ref, int age, bool active, unsigned int matches); unsigned int matches() const { return matches_; }; void set_age(int age); void set_name(const std::string& name_ref) {; void Print() const; private: unsigned int matches_; }; These classes form the basis for the subsequent tasks below. After successful compilation, the following main() program will run. It has been provided in the background for you. int main(void) { SoccerPlayer old_player = SoccerPlayer("Harry", "Soccer_Club", 40, true, 516); std::cout
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