(Save this file asLab 10-2-YourLastName.cpp)Write a C++ program to grade the answers to atrue-false quizgiven to students...
Question:
- Usemain( )as your driver function. Writemain( )so that it allows the user to run the program as many times as desired, as indicated by input from the user.Input/Data validation is NOT required for this program.
- Write appropriatefunctionsthatmain( )callsto accomplish the following tasks:
- (5 points)- Read the number of students who took the quiz and their names. (Hint - Use a 1-D array for the names)
- (5 points)- Read the answer key from the user. (Hint: Use a 1-D array for the answer key)
- (5 points)- Read and store the answers for each student on the quiz. (Hint: use a 2-D array for the answers)
- (5 points)- Calculate the grades. (Hint: Use a 1-D array for the grades)
- (5 points)- Display each students name, quiz answers, and grade.
Sample Input:
This program calculates the grade for students taking a true-false quiz.
How many students took the quiz? 4
Please enter the answer key.
Answer #1: ? T
Answer #2: ? T
Answer #3: ? F
Answer #4: ? F
Answer #5: ? T
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.
Answer #1: ? T
Answer #2: ? F
Answer #3: ? T
Answer #4: ? F
Answer #5: ? T
Please enter the answers for John Smith.
Answer #1: ? F
Answer #2: ? T
Answer #3: ? F
Answer #4: ? T
Answer #5: ? F
Please enter the answers for Betty Hill.
Answer #1: ? T
Answer #2: ? T
Answer #3: ? T
Answer #4: ? T
Answer #5: ? T
Please enter the answers for George Green.
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
Another Sample Input:
This program calculates the grade for students taking a true-false quiz.
How many students took the quiz? 2
Please enter the answer key.
Answer #1: ? F
Answer #2: ? F
Answer #3: ? T
Answer #4: ? F
Answer #5: ? T
Please enter the students' names.
Student #1 Name: ? Mary Hall
Student #2 Name: ? Neal Jones
Please enter the answers for Mary Hall.
Answer #1: ? T
Answer #2: ? F
Answer #3: ? T
Answer #4: ? F
Answer #5: ? F
Please enter the answers for Neal Jones.
Answer #1: ? T
Answer #2: ? F
Answer #3: ? T
Answer #4: ? F
Answer #5: ? T
Another Sample Output:
Student Name Quiz Answers Grade
----------------- ------------------ --------
Key F F T F T 10
Mary Hall T F T F F 6
Neal Jones T F T F T 8
Would you like to process another quiz? Please enter 'y' for yes or 'n' for no: n