Question: write an algorithm and code for the following The game should do the following 1 : Generate a random number between 1 and 1 0

write an algorithm and code for the following The game should do the following
1: Generate a random number between 1 and 100 using the"generate_random_number"function.
2: Use a loop to allow the user to guess the random number. Display a message prompting the user to enter their guess.
3: Call the"check_guess"function with the random number and the user's guess. Display a message indicating whether the guess was correct or incorrect.
4: If the guess is incorrect, provide a hint (higher or lower) to help the user guess the number.
5: If the user has guessed incorrectly 2 times give an additional hint randomly selected between (even/odd number, multiple of 5, the number to the power of 2 is grater/less than 1,000)
5: Repeat steps 2-4 until the user guesses the correct number.
6: Once the user guesses the correct number, display the number of attempts it took to guess correctly.

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 Programming Questions!