[solved]-C History Teacher School Needs Help Grading True False Test Students Ids Test Answers Stor Q39009130
In c++
The history teacher at your school needs help in grading aTrue/False test. The students’ IDs and test answers are stored in afile. The first entry in the file contains answers to the test inthe form:
TFFTFFTTTTFFTFTFTFTT
Every other entry in the file is the student ID, followed by ablank, followed by the student’s responses. For example, theentry:
ABC54301 TFTFTFTT TFTFTFFTTFT
indicates that the student ID is ABC54301 and the answer toquestion 1 is True, the answer to question 2 is False, and soon.This student did not answer question 9. The exam has 20questions, and the class has more than 150 students. Each correctanswer is awarded two points, each wrong answer gets one pointdeducted, and no answer gets zero points. Write a program thatprocesses the test data. The output should be in the form of atable that shows the student’s ID, followed by the answers,followed by the test score, followed by the test grade.
Assume the following grade scale:
- A: 90%–100%
- B: 80%–89%
- C: 70%–79%
- D: 60%–69%
- F: 0%–59%
Using the data file provided, here is what your output shouldlook like:
Key: TTFTFTTTFTFTFFTTFTTF
ABC54102 T FTFTFTTTFTTFTTF TF 27 D
DEF56278 TTFTFTTTFTFTFFTTFTTF 40 A
ABC42366 TTFTFTTTFTFTFFTTF 34 B
ABC42586 TTTTFTTT TFTFFFTF 26D
Design a modular program that grades studenttests and displays the results in a table. A data file,Ch8_Ex6Data.txthas been provided for testing.
Use character arrays to store the answer key and the studentanswers. Character arrays can be read like strings, but they mustbe dimensioned to one greater than the number of characters toaccount for the null terminator.
Some of the answer arrays on the data file provided have blanksat the end. When they are read the length of the array will be lessthan the number of questions and the null terminator will be in thewrong place. Check each answer string as it is read in and if thelength is not correct, add the appropriate number of blanks at theend and move the null terminator to the correct location after thelast answer. The null terminator in C++ is represented like this:”.
At a minimum, your program should contain these functions:
- A function which reads a student record from the data file andverifies that the null terminator is in the correct place. If it isnot, the function should correct the problem.
- A function which takes the answer key and a student record asinput and returns the score
- A function which takes the score as an input and returns theletter grade.
Read the file in a loop and process each student recordindividually.
Include a structure chart with your project and put IPO chartcomments in the main function and for each user defined function ascomments in the code.
Expert Answer
Answer to In c++ The history teacher at your school needs help in grading a True/False test. The students’ IDs and test answers … . . .
OR