Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that will read the data from the input file below SuperBowl.txt. There will be two main data structures for you to store

image text in transcribedimage text in transcribed

image text in transcribed

Write a program that will read the data from the input file below SuperBowl.txt. There will be two main data structures for you to store the data in. The first is a struct with just two members: the team name, and the score. The second main data structure you will use is a two-dimensional array of these structs. If you view this as a table there will be two columns. The first column is a struct for the Super Bowl winner's team name and the winner's score. The second column is a struct for the Super Bowl loser's team name, and score. Treat the number of rows as unknown, as it will increase every year when there is a new Super Bowl, but it is greater than 1 and less than 100. a) You may assume that every row of input contains four values: 1.) The name of the winning team name (note that this might or might not contain spaces, that is it might be one or more words). 2.) The score of the winning team. 3.) The name of the losing team name (note that this might or might not contain spaces, that is it might be one or more words). 4.) The score of the losing team. b) The number of rows is unknown, as the number of Super Bowls will increase over time. c) Below is some example input, with the real team names and scores for the first 4 Super Bowls. Note that a real SuperBowl.txt file is included as input. Green Bay 35 Kansas City 10 Green Bay 33 Oakland Raiders 14 New York Jets 16 Baltimore Colts 7 Kansas City 23 Minnesota 7 | d) Use separate functions for each of the following: 1. Compute the average winning team's score 2. Compute the average losing team's score 3. Compute the maximum score (highest score from any team in any Super Bowl) 4. Compute the minimum score (lowest score from any team in any Super Bowl) e) Print out 6 lines of output, that closely resemble below, with replaced by your computed values: First Super Bowl winner: , score: Most Recent Super Bowl winner: , score: Maximum score from any Super Bowl team: Minimum score from any Super Bowl team: Average winning score from Super Bowl teams: Average losing score from Super Bowl teams: SuperBowl.txt Green Bay 35 Kansas City 10 Green Bay 33 Oakland Raiders 14 New York Jets 16 Baltimore Colts 7 Kansas City 23 Minnesota 7 Baltimore Colts 16 Dallas 13 Dallas 24 Miami 3 Miami 14 Washington 7 Miami 24 Minnesota 7 Pittsburgh 16 Minnesota 6 Pittsburgh 21 Dallas 17 Oakland Raiders 32 Minnesota 14 Dallas 27 Denver 10 Pittsburgh 35 Dallas 31 Pittsburgh 31 Los Angeles Rams 19 Oakland Raiders 27 Philadelphia 10 San Francisco 26 Cincinnati 21 Washington 27 Miami 17 Los Angeles Raiders 38 Washington 9 San Francisco 38 Miami 16 Chicago 46 New England 10 New York Giants 39 Denver 20 Washington 42 Denver 10 San Francisco 20 Cincinnati 16 San Francisco 55 Denver 10 New York Giants 20 Buffalo 19 Washington 37 Buffalo 24 Dallas 52 Buffalo 17 Dallas 30 Buffalo 13 San Francisco 49 San Diego 26 Dallas 27 Pittsburgh 17 Green Bay 35 New England 21 Denver 31 Green Bay 24 Denver 34 Atlanta 19 Saint Louis Rams 23 Tennessee 16 Baltimore Ravens 34 New York Giants 7 New England 20 Saint Louis Rams 17 Tampa Bay 48 Oakland Raiders 21 New England 32 Carolina 29 New England 24 Philadelphia 21 Pittsburgh 21 Seattle 10 Indianapolis 29 Chicago 17 New York Giants 17 New England 14 Pittsburgh 27 Arizona 23 New Orleans 31 Indianapolis 17 Green Bay 31 Pittsburgh 25 New York Giants 21 New England 17 Baltimore Ravens 34 San Francisco 31 Seattle 43 Denver 8 New England 34 Atlanta 28 Philadelphia 41 New England 33 New England 13 Los Angeles Rams 3 Kansas City 31 San Francisco 20 Write a program that will read the data from the input file below SuperBowl.txt. There will be two main data structures for you to store the data in. The first is a struct with just two members: the team name, and the score. The second main data structure you will use is a two-dimensional array of these structs. If you view this as a table there will be two columns. The first column is a struct for the Super Bowl winner's team name and the winner's score. The second column is a struct for the Super Bowl loser's team name, and score. Treat the number of rows as unknown, as it will increase every year when there is a new Super Bowl, but it is greater than 1 and less than 100. a) You may assume that every row of input contains four values: 1.) The name of the winning team name (note that this might or might not contain spaces, that is it might be one or more words). 2.) The score of the winning team. 3.) The name of the losing team name (note that this might or might not contain spaces, that is it might be one or more words). 4.) The score of the losing team. b) The number of rows is unknown, as the number of Super Bowls will increase over time. c) Below is some example input, with the real team names and scores for the first 4 Super Bowls. Note that a real SuperBowl.txt file is included as input. Green Bay 35 Kansas City 10 Green Bay 33 Oakland Raiders 14 New York Jets 16 Baltimore Colts 7 Kansas City 23 Minnesota 7 | d) Use separate functions for each of the following: 1. Compute the average winning team's score 2. Compute the average losing team's score 3. Compute the maximum score (highest score from any team in any Super Bowl) 4. Compute the minimum score (lowest score from any team in any Super Bowl) e) Print out 6 lines of output, that closely resemble below, with replaced by your computed values: First Super Bowl winner: , score: Most Recent Super Bowl winner: , score: Maximum score from any Super Bowl team: Minimum score from any Super Bowl team: Average winning score from Super Bowl teams: Average losing score from Super Bowl teams: SuperBowl.txt Green Bay 35 Kansas City 10 Green Bay 33 Oakland Raiders 14 New York Jets 16 Baltimore Colts 7 Kansas City 23 Minnesota 7 Baltimore Colts 16 Dallas 13 Dallas 24 Miami 3 Miami 14 Washington 7 Miami 24 Minnesota 7 Pittsburgh 16 Minnesota 6 Pittsburgh 21 Dallas 17 Oakland Raiders 32 Minnesota 14 Dallas 27 Denver 10 Pittsburgh 35 Dallas 31 Pittsburgh 31 Los Angeles Rams 19 Oakland Raiders 27 Philadelphia 10 San Francisco 26 Cincinnati 21 Washington 27 Miami 17 Los Angeles Raiders 38 Washington 9 San Francisco 38 Miami 16 Chicago 46 New England 10 New York Giants 39 Denver 20 Washington 42 Denver 10 San Francisco 20 Cincinnati 16 San Francisco 55 Denver 10 New York Giants 20 Buffalo 19 Washington 37 Buffalo 24 Dallas 52 Buffalo 17 Dallas 30 Buffalo 13 San Francisco 49 San Diego 26 Dallas 27 Pittsburgh 17 Green Bay 35 New England 21 Denver 31 Green Bay 24 Denver 34 Atlanta 19 Saint Louis Rams 23 Tennessee 16 Baltimore Ravens 34 New York Giants 7 New England 20 Saint Louis Rams 17 Tampa Bay 48 Oakland Raiders 21 New England 32 Carolina 29 New England 24 Philadelphia 21 Pittsburgh 21 Seattle 10 Indianapolis 29 Chicago 17 New York Giants 17 New England 14 Pittsburgh 27 Arizona 23 New Orleans 31 Indianapolis 17 Green Bay 31 Pittsburgh 25 New York Giants 21 New England 17 Baltimore Ravens 34 San Francisco 31 Seattle 43 Denver 8 New England 34 Atlanta 28 Philadelphia 41 New England 33 New England 13 Los Angeles Rams 3 Kansas City 31 San Francisco 20

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Eric Redmond ,Jim Wilson

1st Edition

1934356921, 978-1934356920

More Books

Students also viewed these Databases questions

Question

Technology. Refer to Case

Answered: 1 week ago