Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C++ program that plays a version of Twenty Questions with the player. Your program must: The list should be at least six items,
Write a C++ program that plays a version of Twenty Questions with the player. Your program must: The list should be at least six items, plus two for each year of prior coding experience you have. Ask a series of questions to guess the right item, at least two questions, plus one for each year of prior coding experience you have. Have a default answer if the inputs are invalid. You must use at least one case switch in your code. Ask the user if they want to play again and loop back through the code. An example of a possible command prompt is provided: In your head, please choose an animal from the following list: CHICKEN FISH LION PIG FLAMINGO SNAIL Press any key to continue... NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN Does your animal live on a farm? (y) : y How many legs does your animal have ? : 0 You picked the fish! Do you want to play again? (y) : y NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA In your head, please choose an animal from the following list: CHICKEN FISH LION PIG FLAMINGO SNAIL Press any key to continue... NNNNNNNN Does your animal live on a farm? (y) : ni How many legs does your animal have ? : 5 I cannot guess, you stumped me (or picked something off the list) Do you want to play again? (y) : Completed and functioning code. (10 points) for successful execution of code-copy the code text to your word document. (6 points) for all results being possible. (2 points) for consistent/appropriate style. (2 points) for commenting
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