Question: Declare necessary classes so that the following main function works as intended. Your classes must be as small as possible in size. Make use of

Declare necessary classes so that the following main function works as intended.

Your classes must be as small as possible in size. Make use of polymorphism as much as possible. Do not use function overloading. Each class must have only one constructor. Do not change the main function. Your code should assume that the number of players that can be inserted to the array is only limited by the available RAM. So do not assume that there will always be three players.

Make sure that there are no memory leaks.

int main() { PlayerArray Players; Players.Insert(new TennisPlayer("Ahmet")); Players.Insert(new SoccerPlayer("Mehmet", 9)); //Integer parameter is the jersey number. Players.Insert(new TennisPlayer("Hatice")); Players.Print(); return 0; }

Output should look like:

Player Ahmet plays Tennis Player Mehmet(9) plays Soccer Player Hatice plays TennisDeclare necessary classes so that the following main function works as intended.

Urgent! Urgent! Urgent!

Question 2 [35 points] Declare necessary classes so that the following main function works as intended. Your classes must be as small as possible in size. Make use of polymorphism as much as possible. Do not use function overloading. Each class must have only one constructor. Do not change the main function. Your code should assume that the number of players that can be inserted to the array is only limited by the available RAM. So do not assume that there will always be three players. Make sure that there are no memory leaks. int main() { PlayerArray Players; Players. Insert(new TennisPlayer("Ahmet")); Players. Insert(new SoccerPlayer("Mehmet", 9)); //Integer parameter is the jersey number. Players. Insert(new TennisPlayer("Hatice")); Players.Print(); return; } Output should look like: Player Ahmet plays Tennis Player Mehmet (9) plays Soccer Player Hatice plays Tennis Question 2 [35 points] Declare necessary classes so that the following main function works as intended. Your classes must be as small as possible in size. Make use of polymorphism as much as possible. Do not use function overloading. Each class must have only one constructor. Do not change the main function. Your code should assume that the number of players that can be inserted to the array is only limited by the available RAM. So do not assume that there will always be three players. Make sure that there are no memory leaks. int main() { PlayerArray Players; Players. Insert(new TennisPlayer("Ahmet")); Players. Insert(new SoccerPlayer("Mehmet", 9)); //Integer parameter is the jersey number. Players. Insert(new TennisPlayer("Hatice")); Players.Print(); return; } Output should look like: Player Ahmet plays Tennis Player Mehmet (9) plays Soccer Player Hatice plays Tennis

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!