Create the following classes:
name – String – name of player
attempted – int – number of field goals attempted
made – int – number of field goals made
There are two constructors
Three parameters – name, attempted and made. If the number attempted is less than the number made, switch the two.
One parameter – name. Set the field goals attempted and made to zero.
setMade – one parameter – it can not be more than the number attempted (error message if wrong)
setAttempted – one parameter – it can not be less than the number made (error message if wrong)
getMade – returns the number of field goals made
getAttempted – returns the number of field goals attempted
getName – returns the player name
getPercentage – returns the field goal percentage (FGP) of the player – returns 0 if no field goals were attempted. (For example if the player attempted 12 and made 7, their field goal percentage would be 58.333333333 percent).
Returns a string showing the players effectiveness.
A player is considered to be excellent if his/her FGP is 90% or over. A player is good if his/her FGP is over 79%, OK if his/her FGP is over 70% and poor if his/her FGP is anything lower. Returns NA if a player has no attempts.
Print out the name, made, attempted, percentage and effectiveness of the player.
Each item should be on a separate line and have an appropriate prompt.
Print a line after all the information is printed.
A Class with a main method
Create an array called team that can store information on 10 players. This must NOT be an ArrayList.
Add the following players to the team:
Jill, 9, 10
Sallie, 0, 3
Mary, 4, 7
Sue, 5, 7
Ali, 0, 0
Sam, 11, 8
Maria, 3, 4
Chris, 9, 5
Pam 2, 2
Marge, 2, 4
Use the methods of the Player class to do the following:
Change the field goals made for Sam to 7.
Change the field goals attempted for Maria to 10.
Change the field goals attempted for Chris to 11.
Use printData to print Sallie’s information
Use printData to print Mary’s information
Calculate and print out the total points scored by the team.
Assume each field goal made is worth two points.
You must use a for loop
Print out the name of the player with the highest score, along with the player’s score.
Print out the name of the shooter with the lowest field goal percentage. Only include players who have attempted at least one field goal.
In a neat table print out one line of information for each player who has attempted a field goal. The line includes the name, made, attempted, percentage and effectiveness of the player.
At the end, print out the total field goals made and the average per player.
Print a line before and after this part (create the line using be a lot of _ or = characters)
Your program should work correctly even if player information is changed
Submit your assignment on Canvas, plus a printout of each of your classes and the output generated by the program.
Some Sample Output:
Field Goal %: 57.14%
Jill 9 10 90.00% Excellent
Sallie 0 3 0.00% Poor
Mary 4 7 57.14% Poor
Sue 5 7 71.43% OK
Sam 7 11 63.64% Poor
Maria 3 10 30.00% Poor
Chris 5 11 45.45% Poor
Pam 2 2 100.00% Excellent
Marge 2 4 50.00% Poor
|Due By (Pacific Time)||11/11/2015 06:00 am|
out of 1971 reviews
out of 766 reviews
out of 1164 reviews
out of 721 reviews
out of 1600 reviews
out of 770 reviews
out of 766 reviews
out of 680 reviews