Question: Write a MIPS program to guess a number. Specification Create a variable called numToGuess and set it equal to your number to guess. Pass a
Write a MIPS program to "guess a number". Specification Create a variable called numToGuess and set it equal to your number to guess. Pass a number entered from the keyboard to a procedure that prints one of the following messages: If the number from the keyboard equals the number to guess, print a "good guess" message. If the number from the keyboard is smaller than the number to guess, print a "too low" message. If the number from the keyboard is greater than the number to guess, print a "too hi" message. and returns 1 for a "good guess" or 0 for a "too low" or "too hi" guess. Allow no more than 5 guesses. If the number is guessed correctly before the 5th guess, print a congratulatory message and exit the program. If the number is not guessed correctly in five guesses, print a "you had your five guesses" message and exit the program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
