Question: -can you solve this question in java programming? : Write a program that plays a simple dice game between the computer and the user. The
-can you solve this question in java programming?
: Write a program that plays a simple dice game between the computer and the user. The computer throws the dice and a random number is generated between 1 and 6. Your program asks the user to guess what the number is. If the users guess is higher than the random number, the program should display That is too high Guess again. If the users guess is lower than the random number, the program should display That is too low Guess again. If the user guesses correctly, Congrats! You nailed it!, is displayed to the user. The program should use a loop that repeats until the user correctly guesses the random number. Remember to keep track of the number of guesses that the user makes (see sample output). You may want to include a sentinel value (of -1), so that the user may exit the dice game at any time.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
