Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

Which are non projected Teaching aids in advance learning system?

Answered: 1 week ago

Question

Describe the Big Five personality dimensions.

Answered: 1 week ago

Question

Identify three personal human relations goals for the course.

Answered: 1 week ago