Question: Need some help with my programming C++ Thanks! Exercise 3.2 Exercise 3.2.1. Revise the program so that it uses a while loop. You can either

Need some help with my programming C++ Thanks! Exercise 3.2 Exercise 3.2.1.Need some help with my programming C++

Thanks!

Exercise 3.2

Exercise 3.2.1. Revise the program so that it uses a while loop. You can either continue to use the do_more variable, or you can instead do away with this variable and use the break keyword to exit as appropriate.

Exercise 3.2.2. After youve played the game a few times (or even if you havent), you should have some idea of the optimum players strategy. Can you summarize this strategy in pseudocode?

Exercise 3.2.3. Assuming that youve completed Exercise 3.2.2, you should be able to write a program that implements the optimum strategy. Assume that you, the user, have picked a number in secret. The program should go into a loop in which it asks YOU (the user) whether the guess is too high, too low, or just right. The program should then use the high/low answer to refine its guess and make another. Note that you are on your honor to answer honestly. Tip: To make the program easy to write, use an arbitrary system of numbers to signal the answer: 1=too high, 2=too low, 3=success. This should be printed in the prompt:

Tell me how I did. 1=too high, 2=too low, 3=success.

Exercise 3.2.4. This exercise is more of a math question than a programming question, but its still interesting. For any game in which there are n possible choices, what is the minimum number of guesses needed to ensure success in the game? (For example, if 7 is this number, it would mean that by following optimum strategy, youll never need more than 7 guesses.)

You should be Introducing Ra Numbers controls the able t see what's going here. A Boolean variable, do whether by action of the loop. Therefore, the program can easily terminate it the setting do more to If not this just reports guessing guess was too high, too low, or just right, and then (if appro- continues to prompt the user. cpp #include

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!