Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is an extra credit project ( not mandatory ) . If you successfully implement the program, you will get 3 % ON TOP OF

This is an extra credit project (not mandatory). If you successfully implement the program, you will get 3% ON TOP OF YOUR FINAL GRADE.
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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 11th International Symposium Sstd 2009 Aalborg Denmark July 8 10 2009 Proceedings Lncs 5644

Authors: Nikos Mamoulis ,Thomas Seidl ,Kristian Torp ,Ira Assent

2009th Edition

3642029817, 978-3642029813

More Books

Students also viewed these Databases questions

Question

8. Explain the difference between translation and interpretation.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago

Question

1. Understand how verbal and nonverbal communication differ.

Answered: 1 week ago