Date Assigned: Tuesday, April 1, or Wednesday,
April 2, 2008.
Due Date: Monday, April 7, or Tuesday, April 8, 2008, before
the beginning of your lab section.
Objective: The main objective of this assignment is to learn to
use arrays of objects.
Programming assignment: The task is the same as in the previous Assignment 9:
Write a program to assist the UTEP athletics department in automating its
record-keeping, especially with the statistics for the 2008 Women’s Basketball
Conference USA Champion Miners team.
Because their winning season is over now, the data file contains
slightly different statistics: the name
of each player on the team, the number of games in which the player participated,
and the total number of points scored by that player during the whole
season. The format of the file is as
follows:
·
The first line
contains the first player’s name;
·
The second line
contains the number of games in which the first player participated;
·
The third line
contains the total number of points scored by the first player during the whole
season;
·
The fourth line
contains the second player’s name;
·
The fifth line
contains the number of games in which the second player participated;
·
The sixth line
contains the total number of points scored by the second player during the
whole season;
·
and so on…
Assume again that the number of players does not
exceed 20. Your program must read the
file, and store each type of data (player’s name, number of games in which the
player participated, total number of points scored by the player). Then, your program must compute and display
the name of each player and the average number of points scored per game by
that player during the whole season. The
average is computed by dividing the total number of points scored by the player
by the number of games in which the player participated.
Main
difference: In the previous Assignment
9, following our advice, you used separate arrays to store the names and point
data about players. For this new assignment, define a class BBPlayer
whose objects contain three fields:
Instead
of using three arrays, use a single array of BBPlayer components (i.e., of
objects of type BBPlayer).
Extra Credit: Determine and display the name and average
number of points scored by the player who has the highest average.
Deliverables: as instructed by your TA.