Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started