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 84Playoff Elimination Problem:
We consider a division that consists of n 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 1 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 1st place (or
tied for 1st). 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 (3), their total
possible wins will equal 80 which is not enough to finish in 1 st place (83). That is, because wins[m]
remaining [m] wins t where m is Washington and t is the team with the most wins, 83 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 83 wins, 71 losses, and 8 games left to be played with
0 of those games against themselves, 1 game against Philadelphia, 6 games against New York,
and 1 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 80 and Dallas already has 83 wins, so there
is no way for Washington to finish in 1st place. Less obviously, Philadelphia is eliminated
because they can finish with at most 83 wins, but since there are 6 games remaining between
Dallas and New York, either Dallas or New York is guaranteed to finish with at least 84 wins.
Trivial Elimination Format: "X has been trivially eliminated by Y."
Non-trivial Elimination Format: "X is eliminated."
Non-elimination Format: "X is not eliminated."
Dallas is not eliminated.
Philadelphia is eliminated.
New_York is not eliminated.
Washington has been trivially eliminated by Dallas.
Test and submit your program as usual in your labs.
 in Python Greater than or equal to 84Playoff Elimination Problem: We

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!