CPSC 220 Fall 2005
Program 3: Rating the Teams

Overview

In programs 1 and 2 you took a list of lacrosse results and developed ways to efficiently store and access game and schedule information. In this program you will develop a rating system for the teams.

Assignment

Write a program that prompts the user for a date and an integer N and prints the top N teams as of that date with the W-L record and rating for each team. The ratings should take into account the games played on the given date.

Program Structure

You will need to develop a strategy to rate each team based on its performance up to a certain point in the season. Write a paragraph or two (not a sentence or two) explaining how your rating system works and why you think it does the right thing. Also explain any apparent anamolies (e.g., teams with better records being rated lower than teams with worse records). Your rating system may use whatever scale seems appropriate, but should distinguish between most teams -- that is, there should be few ties.

Use a priority queue (implemented with a heap, of course) to store the rated teams. You can then get the top N teams just by doing N removeMin()/removeMax() operations (depending on whether your rating system puts better teams higher or lower). Note that each team will need to be Prioritizable, and its priority should be its rating.

Input and Output

As in the previous programs, you will take your input from files teams.dat and scores.dat.

Your program will again be interactive. Dates should be entered in mm/dd format. If the user enters a date past the end of the season, the program should given the final ratings.

What to Turn In

Turn in hardcopy of your program and your rating writeup and e-mail me a tar file of the program.