Read the team members family names from the first data file


Your program will read two data files, set up in the same folder as was done for the
first assignment. These data files are called input2a.dat and input2b.dat.
You program should have the following steps:

1. Read the team members' family names from the first data file and store them (wherever your program design says it is best to do so). There will be 15 names. You may then close the first file.

2. Read the second data file until end-of-file. Each data set in this file will consist of a name followed by a number of Overs Maidens Runs Wickers. It will also be possible for this file to be empty.

3. For each data set, check for data consistency. If any data item is negative the data set is invalid. If overs is less than maidens then the data is invalid. If the number of wickets is greater than 10, then the data is invalid. Any invalid data set is reported with an error message and ignored.E.g. Johnson 6 12 45 2 - data is invalid

4. For each data set, find the correct bowler in your list, add in the number of Overs Maidens Runs Wickets to that bowler's overall performance for the summer. For each bowler, you should also keep a copy of this input data as that bowler's latest performance. If the bowler's name cannot be found, then the data is also invalid, whereupon it is reported as such, and then ignored.
E.g. Johnsen 12 6 45 2 - name not found in team list

5. Calculate the average and strike rate of all players. If you cannot perform a particular calculation you may leave the figure as zero and then deal with this situation when the values are needed to be output.

6. Produce an alphabetically ordered list of the players and their performances overall (including average and strike rate) and their latest performance (just the O M R W values). Use an output format that will right-justify the name. If a result does not exist it can be printed as space characters.

7. Sort the list into decreasing order of bowling performance (best bowler first).

8. Produce a similar list of results to the one above, but this time, only print results for players that have bowled at least 1 over during the summer. Observation: While it is possible to complete this assignment using a number of parallel arrays, your design will be better and easier to work with, if you define your own structured type (it is best to use our naming convention of structname_t), and then have a single array of these objects. Your design will also benefit from having a number of functions. A solution that does not have well designed functions to perform major tasks, will be marked down significantly.

tried to add the pdf file here

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Read the team members family names from the first data file
Reference No:- TGS01246350

Expected delivery within 24 Hours