Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
image text in transcribed
wins 5 4 3 7 14 5 8 12 5 6 9 3 11 2 8 League Standings Analysis Menu 1. Display the full standings 2. Display an individual division standings 3. Sort the standings by winnings 4. Exit the program Enter your choice: 1 Displaying the entire League: League standings Team Mascot Conf/Div Mystery Koalas U1213 East Blue Boomers 11415 South Flying Boars 11213_west Brutal Rovers 11213_North Glorious Penguins 11213_East Wild Magicians 11213_South True Spartans U1617_West Heavenly Angels 11617 North Angry Goblins 11213_East Red Riddles U1213_South Mysterious Capes 11213_West Purple Punas 11213_North Steel Tornadoes 01213 East Rough Wasps U1213 South Swift Mallards 01213West Brute Turtles 11213_North Chief Keefs 11213_East Magic Johnson U1213_South Marvelous Gorillas U1213_West Blue Peacocks 11213_North Gruesome Spartans U1213 East Incredible Crusader 11213_South Major Chiefs 11213_west Gruesome Gators 01213_North Flying Rockets 41415_East Red Cubs 11213 South Flawless Bulls 11415 West Young Saints 11415 North Blue Orcas U1415_East Exalted Cardinals U1415_South Eager Sparks 11415_West Glorious Dogs 41415_North Brown Cougars U1415_Last Spotted Leopards 11415 South Magic Werewolves U1415_West Stark Crunchers 41415_North Nine Mambas U1617_East New Vipers 11415_South Careless Ravens 11415_West Fast Birds 11415 North Infamous Stores 11415_East Pure Orcas 11415_South Grizzly Baboons U1617_West Yellow Monsters U1617_North Spectacular Wolves 11617_East Flying Cubs U1617 South Brute Explorers U1617_West Fabulous Giraffes 11617_North Valiant Ants U1617_East Ancient Phantoms 11617_South Red Rans 11617_west White Goats 11617_North Road Runners U1415_East Purple Queens U1617_South Flying Asteroids U1617_west Major Parrots U1213_North Epic Wolverines 01617_East Daring Dashers U1617_South Blue Trolls U1213 West Skeleton Orcs U1617_North 15 1 16 1e 5 4 3 7 14 5 8 12 5 6 9 3 11 ************************************** Losses winning 11 0.313 12 0.25 13 @.187 9 0.438 2 0.875 10 @.344 8 0.5 4 0.75 11 @.313 10 @.375 7 0.563 12 2.219 8.688 14 0.125 0.5 16 1 2.9375 15 0.0625 1 6 0.625 11 0.313 12 0.25 13 8.182 9 0.438 2 0.875 10 0.344 B 8.5 4 0.75 11 0.313 10 @.375 7 0.563 12 8.219 5 0.688 14 0.125 8 0.5 16 @ 1 2.9375 15 0.0625 e 1 6 0.625 11 0.313 12 @.25 13 0.187 9 0.438 2 8.875 10 8.344 8 0.5 4 0.75 11 0.313 10 2.375 7 0.563 12 2.219 5 8.688 14 0.125 8 0.5 16 @ 1 0.9375 15 0.0625 e 1 6 0.625 8 @ 15 1 16 10 5 4 3 7 14 5 8 12 5 6 9 11 2 8 15 1 16 10 15 0.286 0.892 4 0.923 0.545 0.931 Vancouver Titans PAC_West San_Francisco Shock PAC_East Paris Eternal ATL_North 18 Philadelphia Fusion ATL_South Florida Mayhem ATL_South 17 Los_Angeles Valiant PAC_West Guangzhou Charge PAC_West 18 Shanghai Dragons PAC_East Hangzhou Spark PAC_East 12 Toronto Defiant ATL_North 8 London Spitfire ATL_North 6 Boston Uprising ATL_North Chengdu Hunters PAC_East 8 Dallas Fuel PAC_West 9 Houston Outlaws ATL_South Seoul Dynasty PAC_East 12 Atlanta Reign ATL_South 10 Washington Justice ATL_South New_York Excelsior ATL_North Los_Angeles Gladiators PAC_West 25 6 24 7 12 7 27 11 14 15 19 14 11 15 12 11 4 16 11 3 10 0 2 0 0 0 19 4 11 0 0 0.75 0 0.708 0 0.72 0 0.522 0.364 0.286 0.095 0.364 0.45 0.286 0.5 0.476 18 0 17 0 0.19 0.666 0.524 10 0

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

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago