Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this project you will be writing a program called ChessElo.java that presents an interactive menu for calculating a player s chess Elo under different

For this project you will be writing a program called ChessElo.java that presents an interactive menu for calculating a players chess Elo under different conditions.
First, we must calculate the R values from both players Elo:
R(Player1)=10^{(\frac{Player1Elo}{400})} Note : this is 10^(Player1Elo /400)
R(Player2)=10^{(\frac{Player2Elo}{400})}
Failure to use the provided Strings may result in a loss First, we must calculate the R values from both player's Elo:
R( Player 1)=10(Player1Elo400) Note : this is10???( Player1Elo400)
R( Player 2)=10(Player2Elo400)of points.
For this assignment you may not use Lists, ArrayLists, or String.split().
You should not round during calculations. All final Elo ratings should be Integers. Integer truncation should automatically remove any decimal values. Do not round! Example: 1301.55 would be 1301. When doing multiple Elo calculations you should truncate the value between calculations. From the Example above: when you perform a second calculation you should use 1301 and not 1301.55.
The program will greet the user with a one time WELCOME_MESSAGE before printing the MAIN_MENU.
The user will then select 1 of 4 options.
Your program must handle invalid inputs on the MENU by printing INVALID_INPUT and reprinting the MAIN_MENU.
Option 1- Single Match:
Prompt the user with the SINGLE_MATCH prompt.
The user will input a single match in the format of [Play1Elo]-[W/L][Player2Elo] Examples 1: 1200-W1000(1200 wins vs 1000). Example2: 1350-L1224(1350 loses to 1224)
The program should print the MATCH_OUTCOME prompt followed by the new Elo for the players in the order entered separated by a hyphen '-'. Example Output1: "The Result of the Single Match is 1206-993". Example Output2: "The Result of the Single Match is 1333-1240"
The program should then return to the MAIN_MENU.
You can assume the user will enter a valid parsable input.
Option 2- Tournament Results:
Prompt the user with the TOURNAMENT_RESULTS prompt.
The user will input a single line in the format of [CompetitorElo]-Result[OpponentElo]-Result2[Opponent2Elo]-... ResultN[OpponentNElo]. Example Input: 1350-L1500-W1200-L1480-W1415-L1520
Note that the length of the string is not set, your program should handle all result strings of 1 or greater.
Note: A players Elo changes after EVERY match played. Which will impact the next match's calculation.
The program should print the TOURNAMENT_OUTCOME prompt followed by competitor Elo then each of the opponents' Elo. Example Output: "The Final Tournament Results are 1348-1507-1192-1487-1399-1527".1348 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 MAIN_MENU.
You can assume the user will enter a valid parsable input.
Option 3- Field Prediction:
Prompt the user with the FIELD_PREDICTION prompt.
The user will input a single line in the format [Elo1]-[Elo2]-[Elo3]-...[EloN] Example: 600-1200-400-800-1350
The program should print PREDICTION_OUTCOME prompt, the Elo rating of the lowest player + the maximum amount they can win - the max they can lose, and the Elo rating of the highest player + the maximum amount they can win - the max they can lose. Example: "The Chess Elo Calculator Predicts 400(+24/-7)1350(+7/-25)". In this example the 400 would gain the most Elo by winning against the 1350, but would lose the most Elo by losing to the 600. Meanwhile, the 1350 would gain the most Elo by winning against the 1200 and lose the most Elo by losing to the 400.
The program should then return to the MAIN_MENU.
You can assume the user will enter a valid parsable input.
Option 4- Exit:
The program should print the CONFIRMATION prompt.
The user should then enter yes/y/no/n.
On yes/y the program should print the THANK_YOU message and exit.
On no/n it should reprint the MAIN_MENU.
The program should ignore case for yes/y/no/n.
On invalid input the program should print INVALID_INPUT and reprint the CONFIRMATION prompt.
The program should continue until the user chooses to exit the program from the main menu.
The output should match exactly as expected. Use String variables provided in the starter code.
You may not utilize static or multiple Scanner objects.
You may not utilize java.util.ArrayList, java.util.List, or String.split() for this assignment.
You may not utilize System.exit() in CS18000 assignments.
Sample Test 1
Welcome to the Chess Elo Calculator!
Please Select an Operation
1- Single Match
2- Tournament Results
3- Field Prediction
4- Exit
[1]
Please Enter Player 1's Elo followed by a hyphen '-' then the Outcome followed by Player 2's Elo.
[1200-W1000]
The Result of the Single Match is 1206-993
Please Select an Operation
1- Single Match
2- Tournament Results
3- Field Prediction
4- Exit
[4]
Are You Sure You Want to Exit?
[yes]
Thank You For Using the Chess Elo Calculator!
image text in transcribed

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

Advances In Database Technology Edbt 88 International Conference On Extending Database Technology Venice Italy March 14 18 1988 Proceedings Lncs 303

Authors: Joachim W. Schmidt ,Stefano Ceri ,Michele Missikoff

1988th Edition

3540190740, 978-3540190745

More Books

Students also viewed these Databases questions

Question

(a) What is the complete defining relation?

Answered: 1 week ago