Assignment 5 - Football, structs, and the string class

due Tuesday, 10/27

The purpose of this assignment is to give you practice using structs and the string class.


Program Steps

  1. Read a file containing team names, their conferences and divisions.  This data will be stored in an array of structs.
  2. Read a file containing scores.  Each record in the file must be parsed to determine the winning and losing team.  The number of wins, losses and percentage must be calculated using the data in the scores file.
  3. The array of structs must be sorted by conference, division, and percentage to produce output equivalent to that shown below.

Program Requirements

struct NFL_Team
{
    string name;
    string conference;
    string division;
    unsigned short wins;
    unsigned short losses;   
    unsigned short ties;
};

Program Output

Your output should look quite similar to the following.  Note: the actual statistics will be different when you use the current scores file.

Games through 10/19/20

American  Football Conference

East  Division             W     L     T     Pct
Buffalo Bills              4     2     0   0.667
Miami Dolphins             3     3     0   0.500
New England Patriots       2     3     0   0.400
New York Jets              0     6     0   0.000

North Division             W     L     T     Pct
Pittsburgh Steelers        5     0     0   1.000
Baltimore Ravens           5     1     0   0.833
Cleveland Browns           4     2     0   0.667
Cincinnati Bengals         1     4     1   0.250

South Division             W     L     T     Pct
Tennessee Titans           5     0     0   1.000
Indianapolis Colts         4     2     0   0.667
Jacksonville Jaguars       1     5     0   0.167
Houston Texans             1     5     0   0.167

West  Division             W     L     T     Pct
Kansas City Chiefs         5     1     0   0.833
Las Vegas Raiders          3     2     0   0.600
Denver Broncos             2     3     0   0.400
Los Angeles Chargers       1     4     0   0.200

National  Football Conference

East  Division             W     L     T     Pct
Dallas Cowboys             2     4     0   0.333
Philadelphia Eagles        1     4     1   0.250
New York Giants            1     5     0   0.167
Washington Football Team   1     5     0   0.167

North Division             W     L     T     Pct
Chicago Bears              5     1     0   0.833
Green Bay Packers          4     1     0   0.800
Detroit Lions              2     3     0   0.400
Minnesota Vikings          1     5     0   0.167

South Division             W     L     T     Pct
Tampa Bay Buccaneers       4     2     0   0.667
New Orleans Saints         3     2     0   0.600
Carolina Panthers          3     3     0   0.500
Atlanta Falcons            1     5     0   0.167

West  Division             W     L     T     Pct
Seattle Seahawks           5     0     0   1.000
Los Angeles Rams           4     2     0   0.667
Arizona Cardinals          4     2     0   0.667
San Francisco 49ers        3     3     0   0.500

Program Notes

Hints