Question: if you cant answer all just answer 1)a Question 1 [15 marks]: Assume we have a class called Player, which represents the players of a

 if you cant answer all just answer 1)a Question 1 [15

marks]: Assume we have a class called Player, which represents the players

of a basketball team. A player is defined by last name, shirtif you cant answer all just answer 1)a

Question 1 [15 marks]: Assume we have a class called Player, which represents the players of a basketball team. A player is defined by last name, shirt number (number) and age as the attributes and a set of getter/setter functions as follows: class Player { private: char* last_name; int number; int age; public: Player(); Player (char*, int, int); Player (const Player&); ~Player(); char* getlastname(); void setlastname(char *); int getnumber(); void setnumber(int); int getage(); void setage(); }; 1- a) [4 marks] Implement the copy constructor for the Player class. (hint:string class useful functions: strlen() and strcpy()) - 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: 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) { }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!