CPSC 170A
Program 1: Service Hours
Due Friday, Feb 1, 2002

Problem Description

Your dorm has started a community service program where anyone who completes at least 15 community service hours during the semester gets a cool T-shirt, and the person with the most hours gets dinner for two at their favorite restaurant. The system is simple: when a student participates in an approved service activity, the activity coordinator enters the student's name and the number of hours completed into a master computer file. At the end of the semester, the hours are tallied and winners are determined. Your job is to write a program to process the file at the end of the semester.

Input

Each entry consists of the persons's name on one line, followed by the number of hours completed on the next line. Partial hours (e.g., 2.5) are permitted. The file may contain any number of lines, and a given person may appear any number of times in the file. (If a person appears more than once, the name is guaranteed to match exactly.) The last line in the file will be END. Since there are only 25 people in your dorm, there will be no more than 25 different names in the file (but there might be fewer). For example, a small file might look like this:
Joe
2.5
Mary 
6
Steve
16
Mary 
4.2
Mary
5
Sue
5
END

Your program should use the Keyboard class to read. We will talk in class about how to use redirection to take input from a file.

Output

Your program should produce the following output, all nicely formatted and labeled:

Program Structure

You must organize your program as follows:

Good Advice

The key to this program is keeping the classes straight. The CD example in Chapter 6 of the text might be helpful, as it has a similar organization.