Question: The system will generate a random number between 0 and 100 int number = ( int )(Math.random() * 101 ); Then start asking the user

The system will generate a random number between 0 and 100

int number = (int)(Math.random() * 101);

Then start asking the user to guess the number.

If the user guesses the number tell them success

If the user guesses a number lower than number tell them their number is too low

If the user guesses a number higher than the number tell them they are too high

Repeat asking the user until they get the correct number.

Keep track of the number of guesses - If more than 8 guesses tell the user they got a C. If between 4 and 7 guesses the user got a B. If less than 4 guesses the user gets a A. Use a switch statement to determine what letter grade they got.

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!