Reference no: EM13208135
A basketball lineup is 5 players - 2 guards, 2 forwards and 1 center. A basket ball team is 12 players - 4 guards, 4 forwards and 4 centers. Declare a base class, Player. Player has 2 private data members: name, a string of arbitrary length, and number, an integer; the corresponding public accessors and mutators; and two pure, public virtual methods, say, and position. A Player has two constructors: a default constructor and a one-parameter constructor. Derive the classes Forward, Center, and Guard from Player. The derived class overrides the Player class's virtual methods. The say method writes the player's name, position, and number to an output stream; the position method returns the player's position. A basket ball team has 12 players: 4 guards, 4 forwards and 4 centers. Declare a class Team. A Team has at least 3 private members: team name, a string of arbitrary length, population, an integer, player, an array of 12 pointers to Player. Team has one default constructor, a copy constructor, an overloaded assignment operator and a destructor. Team defines an add method that adds a player to the Team. The add method makes sure that a player's number is unique and makes sure that a team has 4 centers, 4 guards and 4 forwards. Team defines a LineUp method. The LineUp method returns a line-up of 5 players - 2 guards, 2 forwards, and 1 center. The players in a line-up must be unique. Write an overloaded LineUp method that writes a line-up to an output stream.