A basketball team develop a program that hold the statistics (points per team and player). The team has 7 players.
Each player provides the following information:
- Points in each game (10 games played)
Write a program that reports the following information to the output file â€œBasketball_report.txtâ€
Player 1 Name Position total points avg per game
Player 2 Name Position total points avg per game
Team Total points: xxxx Avg per game : xxx.xx
Requirements of the program:
1) Create a class called Player: Write the proper attributes
Name (string), Description (string), points for every game (array of int) and the correct functions (Accessors and mutators that access and update the info of the variables. Create the right specification file and implementation file. (.h and .cpp files)
2) Create a player (player1) and initialize its members to the following values: name=â€â€, description=â€â€ and points [0,0,0,0,0,0,0,0,0,0] through a constructor. (Create a private function called by the constructor to build the array)
3) Create 5 more players using a copy constructor. (Keep those players in an array.
4) The program asks to enter every playerâ€™s info to the user and keep that info in the instance variables of every player (Use the mutators).
5) Create an extra object of the class player (player_extra) and assign player1 to player_extra . (Overload the =operator) Then change Player_extra points (use the mutator to update the array contents)
6) Use the iomanipulators to display the total points of the team ,average points per game, total points per player, and avg per player results in the output file.
Use fixed, setw(), setprecision(2), and showpoint.
2 Extra point(voluntary) : Update the program to read the input data from a file called â€œdata.txtâ€ this should contain all the info for every player but the â€œplayer_extraâ€ in every line.