CPSC 220 Fall 2005
Program 1: Game Scores

File teams.dat holds a list of high school lacrosse teams. File scores.dat holds results for games between these teams. Formats for these files are given in the Input section below. Your job is to write a program that constructs the season schedule for each team, then provides an interface in which the user can repeatedly enter the code for a team and see the schedule for that team (nicely formatted, of course). The schedule should list games by date. For each game it should give the date, the name and code of the opponent, and the result (W/L plus score, with the score of the team whose schedule is being printed coming first). For example, if the user entered code AACMD the program might print the following schedule:
Schedule for AA Christian Eagles

Mar 16  Pallotti (PALMD)                   L  11-13
Mar 18  Durham Riverside (DRINC)           L  4-16
Mar 22  Archbishop Curley (ARCMD)          L  9-18
Mar 31  Maret (MRTMD)                      W  17-6
Apr 5   John Carroll (JCSMD)               L  7-17
Apr 8   Park School (PRKMD)                L  5-13
Apr 11  Key School (KESMD)                 W  13-7
Apr 13  St Johns-Prospect Hall (STHMD)     W  13-10
Apr 15  Archbishop Curley (ARCMD)          L  8-17
Apr 19  Pallotti (PALMD)                   L  10-16
Apr 20  Sts Peter & Paul (SPLMD)           L  8-16
Apr 22  St Johns-Prospect Hall (STHMD)     W  12-9
Apr 26  Sts Peter & Paul (SPLMD)           L  6-15
Apr 29  John Carroll (JCSMD)               L  9-17
May 3   Park School (PRKMD)                L  3-6
May 6   Key School (KESMD)                 W  8-6
May 10  Pallotti (PALMD)                   L  10-19

Guidelines


Input

File teams.dat contains one line describing each team, where each line contains 8 columns as follows:
Region Code School State Conference ConfState Name Coach
These are in fixed-column format and may be interpreted as follows:

Region -- A 1 or 2-character code indicating the team's region
Code -- A 5-character code that uniquely identifies the team
Name -- The name of the team's school
State -- The state where the school resides
Conference -- The conference the team plays in
State -- The state whose rules the conference is governed by
Name -- The team name
Coach -- The name of the coach

For example, consider the entry below (spacing has been modified to display nicely on this page; see file for actual column structure):

20 GONID Gonzaga Prep ID  North WA Bullpups Chris Shogan    
The Gonzaga Prep Bullpups, code GONID, are in region 20 and in the North conference. The school is in Idaho but the conference plays under Washington state rules. The coach is Chris Shogan.

File games.dat contains one line describing each game played during the season, where each line contains 12 columns as follows:

Date Home Visiting HomePts VisitingPts Overtimes Neutral X X X Tourn Champ
These are also in fixed-column format and may be interpreted as follows:

Date -- A 3 or 4-digit code indicating the date of the game. The first one or two digits represent the month and the second two digits represent the day.
Home -- The 5-character code for the home team
Visiting -- The 5-character code for the visiting team
HomePts -- The home team's points for the game
VisitingPts -- The visiting team's points for the game
Overtimes -- The number of overtimes played in the game
Neutral -- 1 if played at a neutral site, 0 if played at home team's field
X -- Unused field (3 of these)
Tourn -- 1 if it's a tournament game
Champ -- 1 if it's a championship game (in which case previous field will also be 1)

For example, consider the entry below:

 117 KLOTX CIRTX 20  2 0 0 0 0 0 0 0
This indicates that on January 17, KLOTX beat CIRTX 20-2 in a regular season game. There were no overtimes and the game was played as KLOTX.