Question: Write a complete program in C + + that figures out the user's number using exactly four yes or no questions. The program will first

Write a complete program in C++that figures out the user's number using exactly four yes or no questions. The program will first tell the user to think of an even number between 2 and 32 inclusive, then after asking the four questions, the program will announce the user's number. Here is a sample runs to show what the questions might look like and how the final answer should be announced. You are free to change the questions as long as they are still yes/no questions and the program never needs more than four yes or no answers to reliably determine the user's number. Notice the user can enter their yes as 'y' or 'Y' and their no as 'n' or 'N'. The program should accept both uppercase and lower case answers.
Please think of an even number between 2 and 32(inclusive).
Is your number bigger than 16? y
Is your number bigger than 24? N
Is your number bigger than 20? Y
Is your number bigger than 22? n
Your number is 22.
Also no variables of any type other than int and char. No loops, no function calls please.

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!