Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1-c) [4 marks] Write the implementation of addplayer() function that adds a player to the array of team members (Team_mem). void B_Team::addplayer(const Player&) { }
1-c) [4 marks] Write the implementation of addplayer() function that adds a player to the array of team members (Team_mem).
void B_Team::addplayer(const Player&)
{
}
1-d) [4 marks] Write the implementation of removeplayer() function such a way that it receives the number of a player as the argument and removes that player from the team member array (Team_mem).
void B_Team::removeplayer(int n)
{
}
- The class B_Team represents a basketball team and it is defined with these attributes the team title, a pointer to a list of players who are currently in the team, and the current number of players in the team (currentsize). Also, the maxsize attribute shows the maximum number of players in a team which can be equal to 12. class B_Team private: string title; int currentsize; const int maxsize; Player * Team_mem; public: B_Team(); B_Team(char*, int, int, string, int, int); B_Team(const B_Team&); void addplayer(const Player &); void removeplayer(int); void display(); /*getter and setters*/ } 1-b) [3 marks] Write the implementation of the following constructor of B_Team class: B_Team(char*, int, int, string int int), - The class B_Team represents a basketball team and it is defined with these attributes the team title, a pointer to a list of players who are currently in the team, and the current number of players in the team (currentsize). Also, the maxsize attribute shows the maximum number of players in a team which can be equal to 12. class B_Team private: string title; int currentsize; const int maxsize; Player * Team_mem; public: B_Team(); B_Team(char*, int, int, string, int, int); B_Team(const B_Team&); void addplayer(const Player &); void removeplayer(int); void display(); /*getter and setters*/ } 1-b) [3 marks] Write the implementation of the following constructor of B_Team class: B_Team(char*, int, int, string int int)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