CS 1401 Assignment #11

Date Assigned: Wednesday, April 9, or Thursday, April 10, 2008.

Due Date: Wednesday, April 16, or Thursday, April 17, 2008, before the beginning of your lab section.

Objective: The main objective of this assignment is to learn to use inheritance.

Programming assignment: The task is the same as in the previous Assignments 9 and 10: 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. The coach is interested in knowing which players are eligible to return to play next year.  Eligibility is determined in part by the player’s grade point average. As a result, the format of the data file has been modified 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 player’s GPA;

·        The fifth line contains the second player’s name;

·        The sixth line contains the number of games in which the second player participated;

·        The seventh line contains the total number of points scored by the second player during the whole season;

·        The eighth line contains the player’s GPA;

·        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, and player’s GPA).  Then, your program must display the name of each player, the average number of points scored per game by that player during the whole season, and whether a player is eligible to play next year or not.  The average number of points scored per game is computed by dividing the total number of points scored by the player by the number of games in which the player participated.  A player is eligible to play if she has a GPA of 2.0 or above.

 

Main difference: In the previous assignment 10, we advised you to define a class BBPlayer whose objects contain three fields:

 

 

Because we want to be able to store information about eligibility (to start with, just GPA; but we may want to add other information in the future), design a new subclass EligibleBBP which contains a new field: GPA. Use inheritance to design this new class. Use objects of the new type in your program.

 

Deliverables: as instructed by your TA.