Question: Using your JSFiddle account you are going to create a guessing game, only it will be the computer doing the guessing. Here is how it

Using your JSFiddle account you are going to create a guessing game, only it will be the computer doing the guessing. Here is how it works the computer will ask you for a number between 1 and 1000, it will check first to make sure your input is within the bounds.

Once you enter the number it will guess the number and do a comparison with the number you entered. It will output the results of the guess and continue to do this until it gets the correct answer. NOTE: THE USER IS NOT THE ONE GUESSING THE USER ENTERS A NUMBER AND THE COMPUTER OUTPUTS ITS GUESSES

This is what the output of the program will look like (if I enter 329). Once again the user inputs the number and the computer searches for it in the Array.

User Input Input: 329
Computer Output Guessed 500 too high.

Guessed 250 too low.

Guessed 375 too high.

Guessed 313 too low.

Guessed 344 too high.

Guessed 329 Got It!

It took me 6 Tries.

You can probably figure out how my algorithm works, yours should use the same basic logic. You will want to create an algorithm that is efficient (lowest possible O).

Programming parameters:

1 This will be coded in Javascript.

2 You should create a dimensioned array of 1000 elements.

3 You should fill in the elements from 1 to 1000 in order prior to implementing the search.

Provide HTML and Javascript to MATCH computer output above.

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!