Create a class called SoccerPlayer Create 4 protected

Create a class called SoccerPlayer

Create 4 protected attributes: First Name, Last Name, Games and Start Date. Start Date should be of type CustomDate1.

Have one constructor in SoccerPlayer

Accepts input of first name, last name, games and start date.

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 two additional protected attributes for Goals Scored and Average Goals per game.

Create get and set method for goals

Create a 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

Create a 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 two additional protected attributes for Saves Made and Average Saves per game.

Create get and set method for Saves Made

Create a 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

Create a 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

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

Create a test program called SoccerPlayerTest.

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 defensemen who does have a red card

Display the info about the players by calling the appropriate toString() methods.

Output:

How Our Website Works

1. FILL IN OUR SIMPLE ORDER FORM

It has never been easier to place your order. Fill in the initial requirements in the small order form located on the home page and press “continue” button to proceed to the main order form or press “order” button in the header menu. Starting from there let our system intuitively guide you through all steps of ordering process.

2. PROCEED WITH THE PAYMENT

All your payments are processed securely through PayPal. This enables us to guarantee a 100% security of your funds and process payments swiftly.

3. WRITER ASSIGNMENT

Next, we match up your order details with the most qualified freelance writer in your field.

4. WRITING PROCESS

Once we have found the most suitable writer for your assignment, they start working on a masterpiece just for you!

5. DELIVERY

Once finished, your final paper will be available for download through your personal dashboard. You will also receive an email notification with a copy of your paper attached to it. Sometimes, the writer may leave a note for you about the order in case there is any additional information that they need to give you.

Leave a Reply

Your email address will not be published.