Question: write this in java he foundation of the Elo system is the probability of a given player beating another. This probability then serves as a
write this in java he foundation of the Elo system is the probability of a given player beating another. This probability then serves as a weight to determine the impact of a win or loss on that players Elo.
First, we must calculate the R values from both players Elo:
RPlayerfracPlayerElo Note : this is PlayerElo
RPlayerfracPlayerElo
If Players Elo was and Players Elo was their R values would be and respectively.
The R value is then used to calculate the probability that that player would win, this is called the expected score.
EPlayerfracRPlayerRPlayerRPlayerfracapprox~
EPlayerfracRPlayerRPlayerRPlayerfracapprox~
As you can see the expected scores will always sum to
Using these probabilities, we can then calculate the updated Elo from the result of using the following equations.
New Elo of Winning Player PlayerEloKEPlayer
New Elo of Losing Player PlayerEloKEPlayer
Note K is a constant, a Kfactor, that is used to control how much change will happen to a players Elo after a match. Low values of K result in Elo ratings that do not move much after a match while higher K values result in major swings in Elo ratings after a match. For this assignment we will be using a constant K value of
Assuming Player wins the updated Elo for each player would be:
PlayerNewElo PEloKEP
PlayerNewElo PEloKEP
Both players Elo should have changed by and equal amount, but because of Integer truncation the values are not rounded so Player lost Elo while Player gained Now what happens if the lower rated player wins?
PlayerNewElo PEloKEP
PlayerNewElo PEloKEP
Player lost points of Elo while Player gained Player is rewarded more for winning since they were at a statistical disadvantage.
Due to the complexity of calculating draws, we will assume that every game has a winner.
The above equations use rounded E values for simplicity only. Keep in mind to not round during calculations and to only truncate the value at the end.
Instructions
For this project you will be implementing an interactive menu using the provided Strings in the starter code. Failure to use the provided Strings may result in a loss of points. For this assignment you may not use Lists, ArrayLists, or String.split Specific Implementation requirements include:
The program will greet the user with a one time WELCOMEMESSAGE before printing the MAINMENU.
The user will then select of options.
Your program must handle invalid inputs on the MENU by printing INVALIDINPUT and reprinting the MAINMENU.
Option Single Match:
Prompt the user with the SINGLEMATCH prompt.
The user will input a single match in the format of PlayEloWLPlayerElo Examples : W wins vs Example: L loses to
The program should print the MATCHOUTCOME prompt followed by the new Elo for the players in the order entered separated by a hyphen Example Output: "The Result of the Single Match is Example Output: "The Result of the Single Match is
The program should then return to the MAINMENU.
You can assume the user will enter a valid parsable input.
Option Tournament Results:
Prompt the user with the TOURNAMENTRESULTS prompt.
The user will input a single line in the format of CompetitorEloResultOpponentEloResultOpponentElo ResultNOpponentNElo Example Input: LWLWL
Note that the length of the string is not set, your program should handle all result strings of or greater.
Note: A players Elo changes after EVERY match played. Which will impact the next match's calculation.
The program should print the TOURNAMENTOUTCOME prompt followed by competitor Elo then each of the opponents' Elo. Example Output: "The Final Tournament Results are is the final Elo for the competitor, and the following Elo values are the updated Elo of the opponents after their match.
The program should then return to the MAINMENU.
You can assume the user will enter a valid parsabl
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
