Question
Write a C++ program that grades the answers to a true-false quiz given to students. The quiz consists of 5 true-false questions. Each correct answer
Write a C++ program that grades the answers to a true-false quiz given to students. The quiz consists of 5 true-false questions. Each correct answer is worth 2 points.
Use main( ) as your driver function. Write main( ) so that it allows the user to run the program as many times as desired, as indicated by input from the user. No data validation is requires for this program.
Write appropriate functions that main( ) calls to accomplish the following tasks:
Read the answer key and the number of students who took the quiz from the user.
Read the student names from the user.
Read and store the answers for each student on the quiz.
Calculate the grades.
Display each students name, quiz answers, and grade.
Sample Input:
This program calculates the grades for students taking a true-false quiz.
Please enter the answer key (use uppercase T or F).
Answer #1: ? T
Answer #2: ? T
Answer #3: ? F
Answer #4: ? F
Answer #5: ? T
How many students took the quiz? 4
Please enter the students' names.
Student #1 Name: ? Mike Jones
Student #2 Name: ? John Smith
Student #3 Name: ? Betty Hill
Student #4 Name: ? George Green
Please enter the answers for Mike Jones (use uppercase T or F).
Answer #1: ? T
Answer #2: ? F
Answer #3: ? T
Answer #4: ? F
Answer #5: ? T
Please enter the answers for John Smith (use uppercase T or F).
Answer #1: ? F
Answer #2: ? T
Answer #3: ? F
Answer #4: ? T
Answer #5: ? F
Please enter the answers for Betty Hill (use uppercase T or F).
Answer #1: ? T
Answer #2: ? T
Answer #3: ? T
Answer #4: ? T
Answer #5: ? T
Please enter the answers for George Green (use uppercase T or F).
Answer #1: ? F
Answer #2: ? F
Answer #3: ? F
Answer #4: ? F
Answer #5: ? F
Sample Output:
Student Name Quiz Answers Grade
----------------- ------------------ --------
Key T T F F T 10
Mike Jones T F T F T 6
John Smith F T F T F 4
Betty Hill T T T T T 6
George Green F F F F F 4
Would you like to process another quiz? Please enter 'y' for yes or 'n' for no: y
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