Question: Need help figuring out this code Assignment #3 Write a complete Java program which will simulate the playing of a game of dice. The will
Need help figuring out this code

Assignment #3 Write a complete Java program which will simulate the playing of a game of dice. The will do the following program The main method will ask the user to type in two integer values, each in the range from to 6, into variables called die1 and die2. Use a boolean method valid to determine whether a die is valid or not. Bad data is to be rejected (except for the special combination you use to end the set of data). For example, if someone types in 3 and -9, the combination is to be rejected. The main method will print the numbers as soon as they are read in. 2. The main method will send these two integer values to a method named outcome. The method will determine the outcome of using these two numbers, according to this scheme: If the numbers add up to 5, 7, or 12, then the player wins, and the method should return an indication of this (use some integer to represent a win). a. If the numbers add up to 2, 4, or 11, then the player loses, and the method should return an indication of this (once again, use an integer). If the numbers add up to anything else, then the game is a draw and the method should say this (by way of an integer). When the method returns to the main method, the main method will use the value returned by the method to print an appropriate message, describing which of the three cases applies in this situation. The main method will then add 2 to the value on the first die and 3 to the value on the second die. However, if the new value would turn out to be more than 6, the new value should be adjusted to fit the range from 1 to 6. [For example, if the two old values were 5 and 2, the two new values would be 1 (5+ 2-61) and 5 (2+3 5). If the two old values were 1 and 5, the two new ones would be 3 (1 +2 3) and 2(5+3-6 2).] The main method should print the two new values, adjusted if necessary, then call method outcome of the method call. again with these new values. Once again, the main method will print the result The main method is to keep statistics about the various results. At the very end, print these statistics. For example, keep track of how many times the original pair of dice gave nner, a loser, or a draw. Do the same for the new pair. Keep track of the amount cf double winners, double losers, etc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
