Question: 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

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 from the dice game at any time.

can you solve this question please and make sure that there are no errors in the projram

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!