Question: in Python Greater than or equal to 8 4 Playoff Elimination Problem: We consider a division that consists of n teams. Each team currently has
in Python
Greater than or equal to Playoff Elimination Problem:
We consider a division that consists of teams. Each team currently has numbers that represent
wins, losses, remaining games yet to be played, and games left to play against team opp. In our
formulation of the problem, only the st place teams will make the playoffs, so we say a team is
mathematically eliminated from playoff contention if they cannot finish the season in st place or
tied for st Assumptions: all games have a winner and loser no ties and every remaining game is
played there are no cancellations
In some cases, it is easy to see when a team has been eliminated. In the example above,
Washington is eliminated because, if we assume they win the rest of their games their total
possible wins will equal which is not enough to finish in st place That is because winsm
remaining wins where is Washington and is the team with the most wins, wins are
more than the total number of wins possible for Washington Dallas in this case Washington is
eliminated bu Dallas. It is less clear, however, if either New York or Philadelphia have been
eliminated because their playoff prospects hinge on not only how many games are left, but also
who those games are scheduled against.
Programming Assignment
Your program will read data from the teams.txt text file provided on eCampus in the format
shown below. The text file begins with the number of teams an integer and is followed by that
number of rows. Each row contains a team name followed by that team's wins, losses, and
remaining games, followed by the schedule of those remaining games with each of the other
teams. In the example below Dallas has wins, losses, and games left to be played with
of those games against themselves, game against Philadelphia, games against New York,
and game against Washington. Note: New York is connected by an underscore, so it can be
handled as a single string.
Read the data, create a Team object from each row, and store it in a list of Team objects. Hint:
As you create the team objects, keep track of the team with the most wins and their number of
wins. For each team in the list, determine if they've been eliminated based on the method
above.
Output your results using the format below. The solution is shown below that. Washington is
eliminated because the most wins they can earn is and Dallas already has wins, so there
is no way for Washington to finish in st place. Less obviously, Philadelphia is eliminated
because they can finish with at most wins, but since there are games remaining between
Dallas and New York, either Dallas or New York is guaranteed to finish with at least wins.
Trivial Elimination Format: X has been trivially eliminated by Y
Nontrivial Elimination Format: X is eliminated."
Nonelimination Format: X is not eliminated."
Dallas is not eliminated.
Philadelphia is eliminated.
NewYork is not eliminated.
Washington has been trivially eliminated by Dallas.
Test and submit your program as usual in your labs.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
