Create Team.h and Team.cpp to implement the Team class as described below. You will also need to create a teamDriver.cpp file to test your Team class implementation. The Team class has the following attributes: Data members (private): teamName : string The team’s name players : an array of Player objects of size 50 The players on this team numPlayers:int The number of players stored in the array Member functions (public): Default constructor Set name to an empty string and numPlayers to 0 Parameterized constructor Takes a string to initialize teamName and sets numPlayers to 0. setTeamName(string) Takes a string to set teamName (and returns nothing) readRoster(string) Takes the file name (a string ), reads a list of player names and their points values, and stores them into the players array for this team. It returns the number of players in the file as an integer. getPlayerName(int) Returns the name ( string ) of the player at position i within the players array getPlayerPoints(int) Returns the points (double) of the player at position i within the players array getNumPlayers() Returns the number of players on this team(as an integer) getTeamName() Returns the name of this team (string ) Method specifications: Team Class Method: readRoster(string) : It takes a file name and reads a list of players and their points separated by a comma. Each player should be stored into the players array. The function returns the number of players stored in the array. If the file cannot be opened, it should return -1. Team Class Method: getPlayerName(int)/ getPlayerPoints(int) : They take the index of a player object within the Player array. For getPlayerName(int) , it returns the name of the player at the given index. If the index is invalid, then it returns “ERROR”. For getPlayerPoints(int) , it returns the point of the player at the given index. If the index is invalid, then it returns -1. What’s an invalid index? An invalid index means that there is no player at that index. There are two cases in which this can occur: 1) The index is greater than or equal to the number of players in the team. 2) the index is not within the bounds of the array. For the zip submissions, the files should be named as Team.h , Team.cpp , and teamDriver.cpp . Your implementation should be organized nicely into separate files. In the main, you should have test cases to test all of your functions.
Answers
Answered by
1
Answered by
5
Answer:
okkkkk......
please mark as brainliest....
Similar questions