Computers and Technology, 25.10.2020 01:00 patrickfryer240
Modify the guessing-game program so that the user thinks of a number that the computer must guess.
The computer must make no more than the minimum number of guesses, and it must prevent the user from cheating by entering misleading hints.
Use I'm out of guesses, and you cheated and Hooray, I've got it in X tries as your final output.
(Hint: Use the math. log function to compute the minimum number of guesses needed after the lower and upper bounds are entered.)
Below are two test runs of the program:
Enter the smaller number: 0
Enter the larger number: 10
0 10
Your number is 5
Enter =, : : >
3 4
Your number is 3
Enter =, : =
Hooray, I've got it in 3 tries!
Enter the smaller number: 0
Enter the larger number: 50
0 50
Your number is 25
Enter =, : : : : : >
1 1
Your number is 1
Enter =, : >
I'm out of guesses, and you cheated!
The results you should get:
number is 3Hooray, I've got it in 3 tries
number is 11Hooray, I've got it in 5 tries
I'm out of guesses, and you cheated
Answers: 1
Computers and Technology, 22.06.2019 03:30
Identify at least three types of characteristics that you were asked about as you the computer identify a fruit.
Answers: 3
Computers and Technology, 22.06.2019 08:30
Linda subscribes to a cloud service. the service provider hosts the cloud infrastructure and delivers computing resources over the internet.what cloud model is linda using
Answers: 1
Computers and Technology, 22.06.2019 16:30
What type of file does a cookie place on web site visitors' computers so that web site managers can customize their sites to their visitors' preferences?
Answers: 1
Computers and Technology, 22.06.2019 17:30
Which tab should you open to find the option for adding a header?
Answers: 1
Modify the guessing-game program so that the user thinks of a number that the computer must guess....
Chemistry, 21.07.2019 23:30
Chemistry, 21.07.2019 23:30
Chemistry, 21.07.2019 23:30
Chemistry, 21.07.2019 23:30
Chemistry, 21.07.2019 23:30
Chemistry, 21.07.2019 23:30
Chemistry, 21.07.2019 23:30
Chemistry, 21.07.2019 23:30
Biology, 21.07.2019 23:30
Social Studies, 21.07.2019 23:30