Create the following classes:
- Player Class
- Fields
- name – String – name of player
- attempted – int – number of field goals attempted
- made – int – number of field goals made
- Constructor
- 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.
- There are two constructors
- Methods
- 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).
- effectiveness
- 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.
- printData
- 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.
- Fields
- 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.
- Poor Shooter
- Print out the name of the shooter with the lowest field goal percentage. Only include players who have attempted at least one field goal.
- Print Team
- 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
