Hockey Career Statistic

Create a program that will calculate and display the career statistics for a hockey player. The program will input the name of the hockey player and the name must be a non-empty string. The number of seasons played, which must be at least one season and no more than 20 seasons, must be provided. Processing the goals and assists cannot start until a valid season value is provided. Once the valid season value is provided, the program will prompt the user to provide the number of goals and assists for each season. The valid number of goals is between 0 and 60 and the valid number of assists is between 0 and 60. The program will keep a running total of the number of goals, the number of assists, and the total points. Also, a list of the each season’s data will be displayed after the season data is provided. Once all the season data is collected, the program shall list the summary information for the player and all the seasons.

1. The customer for your program has decided that they want to change the upper limits for the goals, assists, and seasons. They want the upper limit of the seasons to be 25, the upper limit for the goals to be 70, and the upper limit for assists to be 75.

2. As with most programs that collect names of individuals, the full name shall be broken into two parts: the first name and the last name. Both the first and last name must contain non-empty string values.

3. The customer wants to keep track of how old the player was when he or she started playing hockey, so the program shall provide a field to collect and validate the age of the player when he or she was a rookie. The starting age shall be at least 18 years old and no more than 30 years old, and the age shall be displayed as part of the summary output.

4. The user cannot begin to collect season data until after the first name, last name, seasons, and age are all provided and validated.

New Requirements:

The following are the new requirements that need to be added to the Week 5 Hockey Player Statistics Program:

1. The user shall be able to input information for multiple players. After each player and the number of seasons information is input, the program shall write the summary information for the player to a file called “PlayerStats.txt”. Any previous information that is saved in the file shall be preserved and not lost.

2. Once a player’s summary information has been written to the file, the program shall automatically clear all the input fields and output information for the player and be ready to accept data about another player.

3. Create a second form titled “Player Summary” that shall have operations to open the “PlayerStats.txt” file and display all the summary records for all the saved players.

4. The Player Summary form shall have an operation to clear the contents of the “PlayerStats.txt” file.

5. Exception handling for file operations shall be included to prevent the program from crashing when the files are opened or read.

6. The main form (frmHockeyStats) shall contain a menu that will have two menu items: “File” and “Tools”.

7. Under the “File” menu, there shall be menu items to “Clear” the fields and “Exit” the application.

8. Under the “Tools” menu, there shall be menu items to “Get Player Statistics” and “Summary Data” that opens the summary information forms.

9. Each control (except labels) will have a Tooltip with a short, user-friendly description of what the control provides.

×
New Download