Question: Guessing problem. Write a program which accepts a number, between 0 and 1 2 8 , from player 1 and then accepts guesses from player

Guessing problem.
Write a program which accepts a number, between 0 and 128, from player 1 and then accepts guesses from player 2. If player 2's guess is above or below player 1's number, print out a message, "too high" or "too low" respectively.
When you implement this program, you have to have at least one function using "jal" instruction to call it.(e.g. you may have a function that determines which one is larger or smaller between 2 numbers.)
When the number is guessed correctly, the program will display a message "correct" and the number of tries. Exclude the numbers 0 and 128.
How many tries are required to guarantee a solution? (HINT: binary search) Discuss your answer in the "Comments" section in your code.
 Guessing problem. Write a program which accepts a number, between 0

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!