Question: (Save this file asLab 10-2-YourLastName.cpp)Write a C++ program to grade the answers to atrue-false quizgiven to students in a course. The quiz consists of5true-false questions.

(Save this file asLab 10-2-YourLastName.cpp)Write a C++ program to grade the answers to atrue-false quizgiven to students in a course. The quiz consists of5true-false questions. Each correct answer is worth2points.

  1. 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.
  2. Write appropriatefunctionsthatmain( )callsto accomplish the following tasks:
    1. (5 points)- Read the number of students who took the quiz and their names. (Hint - Use a 1-D array for the names)
    2. (5 points)- Read the answer key from the user. (Hint: Use a 1-D array for the answer key)
    3. (5 points)- Read and store the answers for each student on the quiz. (Hint: use a 2-D array for the answers)
    4. (5 points)- Calculate the grades. (Hint: Use a 1-D array for the grades)
    5. (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

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 Programming Questions!