Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program 1 Tops and Bottoms You are to write a program that will help the local soccer league. In the league to promote balanced play

Program 1 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 3 points if they win a game, 1 point if they
tie a game and 0 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 (Team1 number (home), Team2 number (away), Team1 score, Team2 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 name20 characters left justified,
points3 characters right justified, goals for3 characters right justified, goals against3 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
52
1, Mighty Ducks
2, Iron Men
4, Watermarks
5, Henrys Will
8, Chocolate Bar
g
ames.txt
5420
5122
1242
5821
8201
1844
5231
2433
4803
8520
2500
4100
1404
1524
8401
2800
8132
4524
2111
4231
Example Output
Promoted
Henrys Will 171710
Chocolate Bar 111310
Relegation
Mighty Ducks 71520
Iron Men 7914
Make 2 files one named as League.java and another driver file named as Leaguedriver.java(This should contain main method). I hope you will gonna give the correct output, you can use data structure like Maps, arraylist and do sorting too.
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 (team1.getValue()< team2.getValue())
Do something

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

New Trends In Databases And Information Systems Adbis 2019 Short Papers Workshops Bbigap Qauca Sembdm Simpda M2p Madeisd And Doctoral Consortium Bled Slovenia September 8 11 2019 Proceedings

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Robert Wrembel ,Mirjana Ivanovic ,Johann Gamper ,Mikolaj Morzy ,Theodoros Tzouramanis ,Jerome Darmont

1st Edition

3030302776, 978-3030302771

More Books

Students also viewed these Databases questions

Question

6. Identify seven types of hidden histories.

Answered: 1 week ago

Question

What is the relationship between humans and nature?

Answered: 1 week ago