CSC211-101 Homework 2 – Numerical Data
Due:
The United States Chess Federation (USCF) rates players who play in USCF sanctioned tournaments. You gain or lose rating points by playing a game against an opponent. How many points you gain or lose depends on your rating before the game, your opponents rating before the game, and the outcome of the game. A game can have one of three outcomes: win, lose, or draw.
The actual formula used by the USCF to compute the change in a players rating is fairly involved. However, a good approximation can be obtained by using the following formula:
Change in Rating =
Where:
R1 = your current rating,
R0 = your opponents current rating,
R = 1.0 for a win, 0.5 for a draw, or 0 for a loss, and
C = 0.5 if R1 > 1400, 0.7 if 1200 < R1 <= 1400, or 1.0 if R1 <= 1200.
Write a Java program that prompts the user for: his (or her)
current rating, his (or her) opponents current rating,
and the result of the game (W, D, or L).
Your program should output three quantities: Your rating before the game is played, the change
in your rating, and your new rating (after the game). Rating
Write two
separate programs:
Notes:
Here's the result of one run of my Scanner version of the problem:
Enter your current rating: 2053
Enter your opponents rating: 1735
Enter result of game (W for win, D for draw, L for loss): D
Rating before game: 2053
Rating change: -5.8
New rating: 2048
And here's the result of one run of my GUI version:
Zip your two .java programs into one .zip file and submit
according to
Project Submissions.