Question
Q4) The squads you made in the previous part should have 26 players in each. Now you want to pick a team to play in
Q4)
The squads you made in the previous part should have 26 players in each.
Now you want to pick a team to play in a match.
i)Complete the static method getTeam in the Main class.
It should return a team that has 11 players matching the managers preferred formation.
The goalie is not included but you must have one in your team.
ii) Rank the players using an instance of the Comparator interface to organise your squads players.
iii) Combine all the players attributes and average them to find the best players.
Hints:
. The formation is organised so the first digit is for defenders, the second for midfielders and the final digit for forwards.
For example if the preferred formation is 4-4-2 your team will need 4 defenders, 4 midfielders, 2 forwards and 1 goal keeper. Pick the best players for your team
.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started