Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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-offile. 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 teams name in your data structure. If the teams 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 group and decreasing 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. 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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

What are the purposes of performance appraisals?

Answered: 1 week ago