Lexington High School Mathematics Math Dept. Front Page  | Student Links  | Family Links 
Introduction to C++, Kevin Kelly Kelly Front Page  | C++ Course Guide | C++ Assignments | C++ Info

Team Project Assignment: League Statistics Program

Introduction to the assignment

This assignment will give you the experience of writing some C++ code that will serve as a portion of a larger program jointly written by several people. Each student has been placed on a team, and has been assigned to write one or more functions that will be part of the team's program. A main program that will tie all the functions together has already been written for you.

Each function assignment is described on a separate page. For each function, there is a description of its basic purpose: the minimum capability necessary for the function to serve its role in the larger program. Then, there is a list of potential improvements that will make your function work better, and you may also have some of your own ideas about how to improve your function. (Of course, you should not make any changes that will prevent your function from working together properly with the rest of the program.) It is expected that every student will write a function that fulfills the basic purpose and incorporates at least some of the improvements. The extension part of the assignment will be to go further in improving your own function, and/or to perform additional tasks related to the program at the teacher's request.

Many real-world programming projects are performed for clients that make additional requests as the project progresses. Accordingly, you should anticipate being asked to add additional features to your function, when requested at a later date. At least one added requirement will be announced next week, which will necessitate some adjustments in every function.

Because of the size of this task and the extra work involved in programming as part of a team, this project will count as three programming assignments.

Introduction to the program

The ultimate task for each team is to create a program that will keep track of several statistics for a sports league, such as win/loss records and point totals. The program will allow the user to enter names of several teams, then enter the results of various games played between the teams. The program will tabulate records for each team, and be able to list the teams from best to worst. The program will be capable of storing all of its data into a file, for use at a later time.

A preliminary version of the main program has already been written for you. Here is the C++ code for the main program. The main program presents the user with a menu of several choices; the choices correspond to functions that are each being written by a different student. The code also defines a data structure for storing information that will be used by all of the functions: the variable league is defined as an array of several teams, where each team is a structure variable of type TEAM. Here is an example of a typical way to refer to one piece of information in the structure: league[teamnumber].wins .

You should compile and run the main program in its present form to see how it operates. However, the program won't accomplish anything until the various functions have been written by students. You can start writing your own function inside a copy of this main program file. Later, your team will assemble everyone's functions together into a completely functional program.

Team and function assignments

functionTeam 1Team 2Team 3
newleague ShirAllisonNate
entergame ShirAllisonLeo
printrecords SoyoungKirubaAntonette
printstandings AndrewIanNate
writeleague AndrewAllisonLeo
loadleague ShirIanNate
addteam TarekKirubaAntonette

UPDATE: An additional specification

The program must be able to handle tie games (games where both teams have the same score). Accomplish this by adding int ties; to the TEAM structure, which will work just like wins and losses. Every function will have to be at least slightly changed to allow for ties.