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 Cthat 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 and 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 yesno 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 and inclusive
Is your number bigger than y
Is your number bigger than N
Is your number bigger than Y
Is your number bigger than n
Your number is
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
