Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 Tennisimage text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

Explain the mechanisms of pupil constriction and pupil dilation.

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago