subject

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.

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!

Results: number is 3Hooray, I've got it in 3 tries

Results: number is 11Hooray, I've got it in 5 tries

Results: I'm out of guesses, and you cheated

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
Creating "smart interfaces" in all sectors of industry, government, and the public arena is one of the fastest growing hct areas. these interfaces model, interpret, and analyze such human characteristics as speech, gesture, and vision. the field of biometrics, in which humans authenticate themselves to machines, is an area of considerable interest to hct practitioners. fingerprint scans are one of the most frequently used biometric options, and this article, biometric student identification: practical solutions for accountability & security in schools, makes a case for the implementation of fingerprint scans in schools. critique the article, and answer the following questions: according to the author, what are the main benefits of adopting fingerprint scans in schools for student identification? according to the author, what are the main drawbacks of adopting fingerprint scans in schools for student identification? do you agree with the author's assessment of the pl
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Facial expressions and gestures are examples of messages.
Answers: 3
question
Computers and Technology, 23.06.2019 21:30
Enzo’s balance sheet for the month of july is shown. enzo’s balance sheet (july 2013) assets liabilities cash $600 credit card $4,000 investments $500 student loan $2,500 house $120,000 mortgage $80,000 car $6,000 car loan $2,000 total $127,100 total $88,500 which expression finds enzo’s net worth?
Answers: 1
question
Computers and Technology, 23.06.2019 22:00
Technician a says engine assemblies can be mounted longitudinally in a chassis. technician b says engine assemblies can be mounted transversely in a chassis. who is correct?
Answers: 2
You know the right answer?
Modify the guessing-game program so that the user thinks of a number that the computer must guess....
Questions
question
Computers and Technology, 23.07.2019 23:30
question
Computers and Technology, 23.07.2019 23:30
question
Mathematics, 23.07.2019 23:30
Questions on the website: 13722362