question archive Problem StatementUsing C++ You are to develop a program to read Baseball player statistics from an input file
Subject:Computer SciencePrice: Bought3
Problem StatementUsing C++ You are to develop a program to read Baseball player statistics from an input file. Each player should be stored in a Player object. Therefore, you need to reuse the Player class from program 1. Each player will have a first name, last name, a position (strings) and a batting average (floating point number).This program adds on to the requirements for Program #1. Please see that assignment. This will read in the same type of player data from an input file and write the results to an output file.
New RequirementsYou are to reuse your Player class (or my version) from Program1. You are to implement a PlayerList data structure/data type that stores players in a Linked List structure (internal to the class). Store the players in the list in alphabetical order (By lastname, use firstname to further distinguish in the event there is more than 1 player with the same last name). You will need to add the class PlayerList and the class Node to facilitate the linked list operations.You must implement the following operations on your PlayerList along with any other utility functions you might need. You may also need to add operations to the class Player to facilitate comparisons since Player data is private.
Operationsï‚· Default Constructor
ï‚· Destructor
ï‚· Add a Player to the List
ï‚· Iterate through the List so that you can get each player
ï‚· Clear out the list to make it empty
ï‚· Test if a list isEmpty
ï‚· Get the size of the list
ï‚· Find a Player in the List (get) - Put a couple of hard-coded calls in your main program to make
sure this feature works.
Summary of Operationï‚· Prompt the user for the input and output file names. DO NOT hardcode file names into your
program.
ï‚· Open input file
ï‚· Read each player and add them to your PlayerList
ï‚· Keep track of the number of players in the list
ï‚· Store the players in the list in alphabetical order (lastname then firstname in the event of two people with the same last name). You should be adding them in between other nodes as appropriate
ï‚· Test your find operation a couple of times. This can be hardcoded into your program. You do not have to prompt the user for players, unless you wish to. Just make sure you test for players that exist and that do not
ï‚· Open an output file
ï‚· Write each player from the list into the output file, along with any other output required by the assignment