Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Code Only! Create a class called SoccerUtilities in the com.day4 package. Write 3 methods in total! If you want to add private methods to

Java Code Only!

Create a class called SoccerUtilities in the com.day4 package. Write 3 methods in total! If you want to add private methods to simplify your code, you can do so.

The class outline is below.

com.day4

SoccerUtilities

- increaseSalary(Player, int) : double

- getPlayerByClub(Player[], PlayerClub): Player[]

- findManagerWhoCoaches(Coach[], String): ArrayList

Method 1:

Method increaseSalary will take one Player object and an int. The int represents the percentage out of 100. Method will update the price of the player's salary by the percentage and the method will return the updated salary cost.

For example:

double newPrice = SoccerUtilities.increaseSalary(player[1], 10);

This should increase the salary price of players[1] by 10%. The resulting salary cost will be: 13200.00

If instead, i passed in (students[2], 5), the resulting cost will be: 9450.00

Method 2:

Method getPlayerByClub will take an array of Player and a PlayerClub enum. The method will return an array of students that have match that student year.

For example:

Player[] clubs = SoccerUtilities.getPlayerByClub(players, PlayerClub.Barcelona);

This method should return an array with two players: Lionel Messi and Neymar JR.

If I passed in PlayerClub.RealMadrid, the method would return the following players: Cristiano Ronaldo and Karim Benzema.

Method 3:

Method findManagerWhoCoaches will take an array of Coaches and a String containing the subject to look for. The method will return a list of all coaches who coach that team. This search should not be case-sensitive.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Entity Alignment Concepts Recent Advances And Novel Approaches

Authors: Xiang Zhao ,Weixin Zeng ,Jiuyang Tang

1st Edition

9819942527, 978-9819942527

More Books

Students also viewed these Databases questions