Posted: November 13th, 2015

Computer

Computer

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.
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.

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

Submit your assignment on Canvas, plus a printout of each of your classes and the output generated by the program.

Some Sample Output:
______________________________________________________
Name: Mary
Made: 4
Attempted: 7
Field Goal %: 57.14%
Effectiveness: Poor
______________________________________________________
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
______________

PLACE THIS ORDER OR A SIMILAR ORDER WITH US TODAY AND GET A GOOD DISCOUNT 🙂

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Live Chat+1-631-333-0101EmailWhatsApp