Question
Overview
The computer picks a number between 1 and 100, and you have to guess it.
The computer will tell you whether your guess was too high, too low, or correct.
Your assignment is to generate a random number and let the user guess numbers until they guess the correct number.
Hints
You’re going to want to use some kind of loop. Make sure to exit the loop when the user guesses correctly or hits cancel.
Use constants, MIN and MAX to represent the range of numbers the computer can choose.
You will need to use the Randomizer to generate a number.
The computer picks a number between 1 and 100, and you have to guess it.
The computer will tell you whether your guess was too high, too low, or correct.
Your assignment is to generate a random number and let the user guess numbers until they guess the correct number.
Hints
You’re going to want to use some kind of loop. Make sure to exit the loop when the user guesses correctly or hits cancel.
Use constants, MIN and MAX to represent the range of numbers the computer can choose.
You will need to use the Randomizer to generate a number.
Answers
You will need to use the InputBox to get the user’s guess.
You will need to use the If-Then-Else statement to compare the user’s guess to the computer’s number.
You will need to use the If-Then-Else statement to compare the user’s guess to the computer’s number.
Related Questions
You are asked to guess an integer between 1 and N inclusive.
Each time you make a guess, you are...
Overview
The computer picks a number between 1 and 100, and you have to guess it.
The computer wi...
int sqrt(int number);
sq_root = sqrt(1000);
int sqrt(int number)
int guess=5, i=1;
for(i=1...
The program below should give the user four chances to guess a secret number from 1 to 10. If the gu...