Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Super Bowl The following data for super bowl games is stored in a file named superbowls.txt I 1/15/1967 Green Bay Packers 35-10 Kansas City Chiefs

Super Bowl

The following data for super bowl games is stored in a file named superbowls.txt

I

1/15/1967

Green Bay Packers

35-10

Kansas City Chiefs

Los Angeles Memorial Coliseum

II

1/14/1968

Green Bay Packers

33-14

Oakland Raiders

Miami Orange Bowl

III

1/12/1969

New York Jets

16-7

Baltimore Colts

Miami Orange Bowl

Write a program that will process this file, reading the file name from the user, and then creating a linked list with records containing the following information, ordered by game number.

struct GameDate

{

int month;

int day;

int year;

}

struct SuperBowlNode { char game_number[NUMBER_SIZE];

char win_team[TEAM_NAME_SIZE];

int win_score;

char lose_team[TEAM_NAME_SIZE];

int lose_score;

char location[CITY_NAME_SIZE];

GameDate date;

SuperBowlNode * next;

};

After processing the file, your program should display a menu that allows the user to choose one of the following options:

  1. Print Complete Game List in Reverse
  2. Print Games for a Team
  3. Print Total Points Scored by a Team
  4. Exit

Each option is explained below:

  1. Print Complete Game List: Displays information for all games in a table with the most recent game first. You MUST use a RECURSIVE function for this option.
  2. Print Games for a Team: Reads a team name from the user and displays information for all games that that team played in, ordered by year (game number).
  3. Print Total Points Scored by a Team: Reads a team name from the user and displays the sum of the points scored by that team in all super bowl games that the team played in.
  4. Exit: Exits the program

Your program must continue to display the menu and process selections as stated above until the user chooses to exit the program.

Write a class named GameList that contains a linked list of the SuperBowlNode structures given above. Your class should include a constructor and destructor along with methods to read a file, append a node, display the list in reverse (recursively), display games for a team, and display total points scored for a team.

Store your class declarations and member functions in separate files named with the class name and the appropriate extension (.h or .cpp).

Put your main program in a separate file named sbowl_program.cpp.

I have the .h file completed. I am not sure how to make the readfile function. Any help is much appreciated.

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

Students also viewed these Databases questions

Question

=+Identify the key components of a strategic plan

Answered: 1 week ago