Question: Write a program that stores answers to ten questions in a character array. Each question has one correct answer and four possible answers. (A,B,C,D). Prompt

Write a program that stores answers to ten questions in a character array. Each question has one correct answer and four possible answers. (A,B,C,D).

Prompt the user for ten guesses and store the users answers in another array.

After the user is done entering the answers, show them the correct answer, their answer, and whether they got the question correct or not.

Also show them how many they got right, and how many they got wrong.

 char answers[] = {'A', 'B', 'C', 'D', 'B', 'A', 'B', 'C', 'D', 'A'};

char guesses[10]; //this will store the user answers

Sample Execution:

Enter your guess for Question 1 (A,B,C,D): A

Enter your guess for Question 2 (A,B,C,D): B

Enter your guess for Question 3 (A,B,C,D): F

ERROR!! Guess must be A,B,C,D

Enter your guess for Question 3 (A,B,C,D): D

Enter your guess for Question 10 (A,B,C,D): D

Here are the results of your quiz:

Question 1: Correct Answer: A Your Answer: A Correct.

Question 2: Correct Answer: B Your Answer: B Correct.

Question 3: Correct Answer: C Your Answer: D Incorrect.

Question 10: Correct Answer: A Your Answer: D Incorrect.

You got 4 questions right.

You got 6 questions wrong.

You got 40%.

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!