CS 12: Programming Assignment 5

Directory to turnin: as5

Due date: Tuesday Nov 14, 2000

Synopsis:

In this assignment, you are going to write a class that maintains information about a sports team. Be sure to do a good job on this assignment, as you will be using it in the next assignment.

Details:

This program should consist of 3 source files:

team.h:

This file contains the definition for the sports Team class. The class definition should include member variables for the following:

The class should also contain member functions to do the following:

team.cpp:

This file will contain the implementation of the Team class.

main.cpp:

This file should contain your main function. It should prompt the user for the name of a team and a season (i.e. year), then create a sports team object. Note that a team name might be more than one word, so use cin.getline() when prompting for this.

The function should then present a menu of options to the user:

      P) play game
      D) display team info
      S) show winning percentage
      Q) quit

      Select option:
Depending on which option the user chooses, the appropriate Team member function should be called. Put the menu in a loop so that after performing each operation, the menu is shown again, until the user chooses to quit.

If play game is selected, the user should be asked whether the team won or lost the game, then call either WonAGame or LostAGame.

If show winning percentage is selected, the display should be rounded to 2 decimal places.