Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solve this as it should generate the expected output. Use java , you can use maps or any suitable data structure.Your program must use a
Solve this as it should generate the expected output. Use java you can use maps or any suitable data structure.Your program must use a comparable class. Your program can not do a pull value comparison. For example you can't do some like:
if teamgetValue teamgetValue
Do something
Your program driver class, the class that contains your main, must be called LeagueDriver.java.
Program Tops and Bottoms
You are to write a program that will help the local soccer league. In the league to promote balanced play
teams are put in multiple level brackets and at the end of each season the teams are shifted up if they
are one of the best teams and shifted down if they are one of the worst teams. Your job is to write a
program determines what teams are to be promoted or demoted. The program will rank the teams
based on a specific scoring mechanism. Teams are awarded points if they win a game, point if they
tie a game and points if they lose. In the case of a tie on points the tiebreakers are determined by
goals scored then goals allowed and finally the team number which defines in which order the team
entered the bracket. Your program must utilize your own quick sort algorithm to determine the
promotions and demotions.
Specifications:
Input:
The input will be two files: Teams.txt and Games.txt
teams.txt two numbers the first being the number of teams and the second being the number of teams
that will be promoted or demoted followed by multiple lines containing the Team Number and Team
Name separated by a comma with a single team on each line
games.txt Team number home Team number away Team score, Team score one game on
each line
Output:
Will be a line stating Promoted followed by single lines of team name and the number of points they
currently have, the number of goals scored and goals allowed. Team name characters left justified,
points characters right justified, goals for characters right justified, goals against characters
right justified
Then a blank line followed by a line stating Religation followed by single lines of team name and the
number of points they currently have, the number of goals scored and goals allowed. Line format same
as Promoted.
Example Input
team.txt
Mighty Ducks
Iron Men
Watermarks
Henrys Will
Chocolate Bar
games.txt
Example Output
Promoted
Henrys Will
Chocolate Bar
Relegation
Mighty Ducks
Iron Men
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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