Problem Description: Player # Player\'s Name GP GS Total Mins Total FG Total FGA
ID: 3925010 • Letter: P
Question
Problem Description:
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
Design a class named Player with fields for holding a Women’s Basketball player’s statistics. All fields should be private.
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.
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
a) public Class player {
praivate int GP=29;
praivate nt GS=28
praivate int totalminutes=890
praivate nt totalFG=131
praivate nt totalFGA=331
praivate int 3FG=33
praivate int 3FGA=125
praivate int FT=84 ,praivate int FTA= 117 ipraivate nt offREB= 23 , praivate int diffREB= 57 ,praivate int PF= 68 ,praivate int A= 73 ,praivate int TO=91 ,praivate nt stl= 46 ,praivate int total ponits=379 ;
b) //mutator method
//accessor methods for the above functions :
public int gettotalMinutes()
{
return totalMinutes;
}
public int gettotalPoints()
{
rturn totalPoints ;
}
c)// average minutes played per game by individual
public int avgMins()
{
system.out.println("average ",+A);
}
d) // feild goal percentage
public int fieldGoalPErcentage()
{
int n;
n=(3FG/totalFG)*100;
system.out.println("percentage ",n);
}
Similarly we can compute others if we know full forms of the given fields
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.