Question: Objective Demonstrate knowledge of recursion by describing common applications and by effectively using it to solve problems. Use of appropriate algorithms to solve common computing

Objective
Demonstrate knowledge of recursion by describing common applications and by effectively
using it to solve problems.
Use of appropriate algorithms to solve common computing problems.
Problem
In this assignment, you will write a guessing game. In this program, you will create an array of 20
elements and write a method that randomly generates integer values between 1 and 100
(inclusive). The method then uses the Java built-in sort function Arrays.sort(myArray) to sort
the array in ascending order and returns the sorted array. The program then asks the user to think
of an integer between 1 and 100. The program then uses a modified binary search algorithm to
guess the value.
The program may ask the user a question such as Is your number greater than 61? See below for
example sample runs. Your program should have a worst-case time of O(log n), where n is the size
of the collection object.
Sample run #1: Value NOT FOUND in the collection (target =63)
Choose a random number between 1 and 100.
For the following questions, enter "Y" for Yes or "N" for No.
============
Is your number greater than 56? y
Is your number 76? n
============
Is your number greater than 76? n
Is your number 68? n
============
Is your number greater than 68? n
Is your number 66? n
============
Is your number greater than 66? n
Is your number 58? n
============
Is your number greater than 58? y
Is your number 66? n
=============================================================================
SORRY! Your number is not in the collection.
=============================================================================
Here is the Collection:
8,8,23,28,31,37,38,49,54,56,58,66,68,73,76,82,84,87,98,98,

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 Programming Questions!