Question: make class called TeamInfo Create 3 private attributes: Team Name, Team City, Team League. Have one constructor in TeamInfo that accepts all three attributes as
make class called TeamInfo
Create 3 private attributes: Team Name, Team City, Team League.
Have one constructor in TeamInfo that accepts all three attributes as parameters
Create get and set methods for each of the three attributes.Also make toString method.The toString should display the team, the city and the league.
make class called SoccerPlayer
Create 4 protected attributes: First Name, Last Name, Games and Team Info.Team Info should be of type TeamInfo.
Have one constructor in SoccerPlayer
Accepts input of first name, last name, games played and team info.
Create get and set methods for each of the first three attributes and a toString method.
Create 3 additional classes that extends SoccerPlayer.These three classes should be called Forward, Defense and Goalie.Each of these classes needs their own constructor that calls the Superclass constructor as well as fills in the new protected attributes for the class.
Class Forward should include one additional protected attribute for Goals Scored.
Create get and set method for goals
make method that calculates the average number of goals scored per game.
This method checks for zero games played:
If there are zero played, display an error and set average to 0;
If greater than zero, do the math and set average to result of calculation
make toString method that displays all of the inherited info, the number of total goals scored and the average number of goals per game displayed to one decimal place.
Class Goalie should include one additional protected attributes for Saves Made.
Create get and set method for Saves Made
make method that calculates the average number of saves per game.
This method checks for zero games played:
If there are zero played, display an error and set average to 0;
If greater than zero, do the math and set average to result of calculation
make toString method that displays all of the inherited info, the number of total saves and the average number of saves per game displayed to one decimal place.
Class Defense should include two additional protected attributes for total number of tackles and if the player has a red card (which should be a Boolean).
Create get and set method for both attributes
make method that calculates the average number of tackles per game.
This method checks for zero games played:
If there are zero played, display an error and set average to 0;
If greater than zero, do the math and set average to result of calculation
make toString method that displays all of the inherited info, the number of tackles and displays a message stating if the player is playing or is suspended due to a red card.
make test program called SoccerPlayerTest.
make the instance of the TeamInfo.The team info will be used by all four players.
Create four instances of players.
The first should be a forward
The second should be a goalie
The third should be a defenseman who does not have a red card
The fourth should be a defenseman who does have a red card
Display the info about the players by calling the appropriate toString() methods.
Note:All numeric input MUST be validity checked for negative input.The SoccerPlayerTest should include a single static method that checks if the value entered is a negative number.The program MUST display an error message and allow the reentry of the value.


\f\f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
