Engg1003 - introduction to procedural programming - produce


TASKS:

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 team.dat and match.dat.

You program should have the following steps:

1. Read the national football team names and the group they belong to from the first data file and store them (wherever your program design says it is best to do so). There will be 32 names, and each group contain 4 teams. You may then close the first file. You may assume that this first data file does not contain any errors at all. The file contains the team names ordered per group.

2. Read the second data file, reading and processing one data set at a time, stopping at end-of- file. The second data file will contain data for all the games played during the current time period. Each data set in this file will consist of a result for an individual game, and will consist of 2 team names, each followed by a number of goals (that is, each data set will have the form: first_team first_score second_team second_score). 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. Any invalid data set is reported with an error message and ignored.
E.g. Colombia 3 Poland -1 - data is invalid

4. For each data set, find the correct team's name in your data structure. If the team's name cannot be found, including matching exactly by case, then the data is also invalid, whereupon it is reported as such, and then ignored.
E.g. Columbia 2 Japan 1 - name not found in team list australia 1 France 1 - name not found in team list

5. Once the data set is valid, for each match, you will need to record the result for each team (that is the win for one team and the loss for the other, or a draw for both of them), and the goals counters. This will involve updating the data values for the respective teams. You will need to search for the names of the teams and record the respective result for each team.

6. Produce a by performance by group decreasing ordered list of the teams as per required table of reporting (below). Use an output format that will left-justify the name. This should be reasonably simple since the team names were originally input in by group order.

7. Produce (sort) an alphabetically ordered list of the teams and their performances as per required table of reporting (below). Use an output format that will left-justify the name.

8. Produce (sort) a list of teams by decreasing order of team performance as per required table of reporting (below). This will be a challenging task - think carefully about how you will compare the ranking of any two teams - this becomes the basis for sorting.

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 structure(s) type (it is best to use a 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.

Attachment:- Assignment.rar

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Engg1003 - introduction to procedural programming - produce
Reference No:- TGS02789305

Expected delivery within 24 Hours