Problem Description: Design a class named Player with fields for holding a Women
ID: 3803969 • Letter: P
Question
Problem Description:
Design a class named Player with fields for holding a Women’s Basketball player’s statistics. All fields should be private.
Player #
Player's Name
GP
GS
Total Mins
Total FG
Total FGA
3FG
3FGA
FT
FTA
Off Reb
Def Reb
PF
A
TO
Stl
Blk
Total Pts
11
McGowan, Angel
29
28
890
131
331
33
125
84
117
23
57
68
73
91
46
3
379
Write the appropriate mutator and accessor methods for the class’s fields. The class should also have methods that can compute the following:
The average minutes played per game by the individual
The field goal percentage for the individual
The 3 point FG percentage for the individual
The free throw percentage for the individual
The average rebounds for the individual
(25 points)
Next, design a class named Roster, which contains an array or ArrayList of Player objects. The class should also have methods that can compute the following:
Import a text file with stats information for multiple players (see example above) and create the Player objects.
Save all statistics from the array/ArrayList of Player objects to a text file
Display, in order, the top 3 individuals who has scored the most total points for the season
Display, in order, the top 6 scorers per game on average.
Display, in order, the top 3 assists per game on average.
Display, in order, the 4 players with the least number of personal fouls.
(60 points)
Use exceptional handling where appropriate. I will attempt to break your program. (10 points)
Write a client (a test class with the main method) to test all the methods and constructors of your classes.
The included stats file is for your testing purposes, I will use a completely different file for my testing. So ensure you code is not hard coded for the student file.
**HERE IS THE TEXT FILE
Player # Player's Name GP GS Total Mins Total FG Total FGA 3FG 3FGA FT FTA Off Reb Def Reb PF A TO Stl Blk Total Pts Scored
11 "McGowan, Angel" 29 28 890 131 331 33 125 84 117 23 57 68 73 91 46 3 379
35 "Butler, Patrice" 27 18 544 131 271 20 54 48 64 43 105 62 13 51 14 9 330
24 "Knight, Anna Claire" 29 29 918 120 327 21 85 52 74 45 117 44 53 82 37 7 313
14 "Jones, Briana" 27 26 541 67 148 0 0 23 31 29 96 59 20 35 17 38 157
23 "Sams, Alexis" 29 29 891 47 138 37 109 22 27 7 54 47 59 60 21 3 153
Player #
Player's Name
GP
GS
Total Mins
Total FG
Total FGA
3FG
3FGA
FT
FTA
Off Reb
Def Reb
PF
A
TO
Stl
Blk
Total Pts
11
McGowan, Angel
29
28
890
131
331
33
125
84
117
23
57
68
73
91
46
3
379
Explanation / Answer
define class player:
class player {
char str1 = "GP";
char str2 = "GS";
int Total_min;
int Total_FG;
int Total_FGA;
-----------
}
return_type function_name( parameter list ) {
body of the function
}
avg_min_played();
goal_percentage();
three_point_FG_Percentage();
free_throw_percentage();
avg_rebounds();
class roaster
{
create array of objects created in player class.
try
{
}
catch
{
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.