Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C++ program to analyze league standings (data). Read in the standings from a file called OverwatchLeague.txt available on Canvas. You will need to
Write a C++ program to analyze league standings (data). Read in the standings from a file called OverwatchLeague.txt available on Canvas. You will need to use basic File I/O to do this. Display a menu of options to the user. Options will include the following:
Allow the user to display all teams and their winning percentage.
Allow the user to display individual division standings. This will display all teams in the division along with their number of wins, losses, and winning percentage. You will need to ask the user what conference and division.
Allow the user to sort the teams by winning percentage.
Allow the user to quit your program.
It is required that you store the standings in a dynamically allocated array or arrays. If the user wants to analyze a different league such as a basketball league or hockey league with different numbers of leagues and teams your program will still work. They would just need to provide a different input file such as NHLdata.txt for the National Hockey League. On Canvas is another standings files called LittleLeague.txt and "NFLdata.txt".
Note that the number of teams in the file to be analyzed varies and you need to dynamically allocate for that. Note that for each team the input file contains: team name, team mascot, conference/division, wins, losses, ties, and winning percentage. It is required that you group this team data as an individual collection called a struct. Give your struct a name like TeamInfo.
It is expected that you write your program with major chunks of the program being functions. For example, sorting is a natural function and displaying standings is a natural function. (Also swap is a natural function called by a sorting function, etc. In the main function include the logic for the user menu and call functions within that logic. The result will be a cleanly organized main function.
REQUIRED output is provided below (Output should look exactly like RequiredOutputHW1.txt. This is one example run of the program with LittleLeague.txt).
Overwatch.txt
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started