Question: Problem 3. Game.java: (1) Ensure user to enter an integer in [1, 6] from the keyboard, that is, an integer from 1 to 6. Note

 Problem 3. Game.java: (1) Ensure user to enter an integer in

Problem 3. Game.java: (1) Ensure user to enter an integer in [1, 6] from the keyboard, that is, an integer from 1 to 6. Note that if a user enters an integer other than 1, 2, 3, 4, 5, 6, your program would force the user to re-enter again. (2) Let computer generate a random integer in [1, 6]. Print it out. (3) If the user and computer generate the same integer, print out "a tie"; otherwise, if the user's input is a multiple of the computer's number, print out "user wins"; otherwise, if the computer's number is a multiple of the user's input, print out "computer wins"; otherwise, print out "undecided" For example, 6 is a multiple of 2 since 6 can be divided by 2. Said differently, given two integers m and n, integer m is a multiple of n if the remainder of m divided by n is zero

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!