Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use iostream if and switch statement and score counter to solve this problem there is an example attached below thanks What famous character are
please use iostream
What famous character are you? quiz A common staple on the internet, this week's program will involve asking the user a set of questions and determining which famous character they resemble based on their answers. There is no set topic for this program, so pick whatever interests you. At a minimum, there must be at least 3 characters that the user can be according to the quiz. The program must do the following: Ask the user at least three questions. For each question, you should provide a list of answers that each correspond to one of the characters you have chosen. Each question should have a clearly marked letter or number that the user may enter to select that answer. Use a char variable to read in the user's answe r . Use a switch statement to add points to a particular character based on the answer selected. To make it easy, have each answe add a single point to just one of the possible characters. .If the provided answer does not match any of your choices, output an appropriate error message and end the program with return 1. After asking all your questions, use an if statement to determine which character has the most points and inform the user which character they are most like. .Points should be tracked in int variables, one for each character. Once the program is working, show both the code and the output to your lab instructor. program should look similar to these examples: EXAMPLE Which cephalopod are you? 1. Wh en you are confronted with danger, you do the following: al squirt out a cloud of ink and swim away (bl Use camouflage to hide in the sand. c] Create hypnotic patterns with my skin. Answer: b 2. How many appendages do you have? [al 8 arms and 2-3 tentacles, don't ask. Ibl 2 long tentacles and 8 arms. [c] Just the eight arms. Answer: c 3. What is your favorite old one? Ial Ia! Ia! Cthulhu Fhtaghn! [bl Shudde M'ell Ic] Yibb-Tst1l Answer: a You are an octopus! You bring lots of love and hugs to those around you with your eight arms and three hearts. EXAMPLE Which cephalopod are you? 1. When you are confronted with danger, you do the following: [al Squirt out a cloud of ink and swim away. [bl Use camouflage to hide in the sand. [c] Create hypnotic patterns with my skin. Answer: a 2. How many appendages do you have? [a] 8 arms and 2-3 tentacles, don't ask. [bl 2 long tentacles and 8 arms. [c] Just the eight arms. Answer: z Unexpected answer. Please try again later. How to use Switc Statements cout if and switch statement and score counter to solve this problem
there is an example attached below
thanks
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