COSC 071: Computer Science I

Project 4: Chappy and Chippy's Racing Roster
Fall 2001

C++ Implementation (electronic) due: Nov. 19 @ 2:30 PM
9 points

Chappy and Chippy have been trying to get in touch with you about another programming project, and were annoyed that you were off working for the phone company. Now that they have you again, they want you to help them out with a sailboat racing league they have started. This league is for adults only, ages 15-54, and is only for residents of DC, Maryland, and Virginia. There is a men's and women's division. Each boat will have two sailors working as a team. Each of the sailors on the team will live in the same state, be of the same sex, and will both fall into one of the following inclusive age brackets:


What Chappy and Chippy would like you to write a program that can read a roster file that contains information about a number of interested racers. Once that file has been read, the program should accept information about a new racer from keyboard input, and then look through the roster and print out all possible racing companions for the new racer.

The roster file has the following format:
<firstname> <lastname> <age> <sex> <location> <phone number>


<firstname> is the racer's first name
<lastname> is the racer's last name
<age> is the racer's age
<sex> is a code for the racer's sex, with F for female and M for male;
<location> is a code for the racer's state, with M for Maryland, V for Virginia, and W for Washington, D.C.
<phone number> is the racer's phone number

A sample roster file is available as sailors.txt.

Guidelines and Hints

Create a class that can be used to store information about each racer. This class should have a method that, given another object of the same class, tells if they would be compatible teammates or not.

Use a vector to store the racers on the roster. Search through the roster to find appropriate matches.

Instructions for Electronic Submission: At the top of the file containing your source code (i.e., the file containing the C++ instructions), place the following header comment, with the appropriate modifications:

// Project 2
// Name: <your name>
// E-mail: <e-mail address>
// Instructor: Maloof | Shields
// TA: <TA's name>
// COSC 071-<section number>
// Platform: Solaris (gusun) | Linux | Windows | Macintosh
// Compiler: g++ | Visual C++ | CodeWarrior | Borland  etc.
// Description: <Describe your program>

Although you may use any C++ compiler to develop your program, it must run under UNIX and must compile using GNU g++. When you are ready to submit your program for grading, if necessary, use ws-FTP to transfer your file from your PC to gusun. Use SSH to logon to gusun, and use pine to e-mail it to your TA with your netid and the suffix ``.cc'' as the subject. To run pine, type at the UNIX prompt:

gusun% pine

When the menu appears, select the item for composing e-mail. Assume that your netid is ab123, the name of your source file is proj1.cpp, and your TA's e-mail address is ``''.

Type your TA's e-mail address in the To field, and type your netid with the .cc suffix in the Subject field (no spaces before or after). Move the cursor down into the MESSAGE TEXT screen, and type the ^R command. Pine will ask for a file name (e.g., proj1.cpp), which it will then load as your message text. At this point, your screen should look something like the following:

Finally, type ^X to send the e-mail to your TA.

IMPORTANT: Do not send your source code as an attachment. Do not use a mail client other than pine.

If you need to include a message to you TA about your submission, then type the message as a comment in the program.

Once you've submitted your project, it is important to keep an electronic copy on a university machine (e.g., gusun or cssun) that preserves the modification date and time. If we lose your project or the e-mail system breaks, then we will need to look at the modification date and time of your project to ensure that you submitted it before it was due.

The TAs who will be grading your projects this semester is listed on the main page. You must e-mail your project before 4:00 PM on the due date.