Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this project you will be tasked with writing a program to play a guessing game between another player and your program. Your program will

In this project you will be tasked with writing a program to play a guessing game between another player and your program. Your program will start by initializing an array to 5 fixed values in the ranges of 1-1000 in the array. These values should also be in order (sorted).
Your program will then begin by asking the player to make a guess from 1-1000. For the first guess of the user, your program will only tell the player if they guessed correctly or not. However, the program will keep track of how close they are to the closest element in the array. The program will then go into a loop, asking the player for a new guess each time. If at any time, their new guess is farther away from the closest number than their previous guess, the program will respond with Getting colder!. If they get closer to a correct guess, the program should respond with Getting warmer!. This should continue until the player guesses one of the numbers in the list. Your program should then output Success! and then end.

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

Accounting

Authors: Charles T. Horngren, Walter T. Harrison Jr., M. Suzanne Oliv

9th Edition

130898414, 9780132997379, 978-0130898418, 132997371, 978-0132569309

Students also viewed these Databases questions