• Home
  • Blog
  • Write a program that produces the output shown below. Your implementation must use parallel arrays to store and process student IDs and student test answers and should be based on the following information:

Write a program that produces the output shown below. Your implementation must use parallel arrays to store and process student IDs and student test answers and should be based on the following information:

0 comments

In C++ plz

Your Math professor needs help in grading a True/False test. The students’ ID and test answers are stored in a file testScores.txt. The first entry in the file contains answers to the test in the form:
TFFTFTFFTFTTFTFTFFTT
All other entries in the file consist of a student ID, followed by white space, followed by a student’s responses and a new line. For example, the entry:
ABC54301 TFTFTFTT_TFTFTFFTTFT
indicates that the student ID is ABC54301 and the answer to question 1 is True, the answer to question 2 is False, and so on. This student did not answer question 9, so there is an underscore (‘_’) in position 9. The exam has twenty questions and the class will never have more than 30 students.
Each correct answer is awarded two points, each wrong answer gets one point deducted, and no answer gets zero points. The lowest possible total point score is zero. Write a program that processes the test data from the input file. The output should be a table header followed by the student’s ID, followed by their answer, followed by their % score, followed by their letter test grade as illustrated below. Assume the following grade scale: 90% – 100% A; 80% – 89.99% B; 70% – 79.99% C; 60% -69.99% D; and 0% – 59.99% F. After outputting all the student data, output the student IDs with the minimum and maximum percent scores and average percent score for the entire test.
Write and use the following two functions (with prototypes above your main function and implementations below it) to help with the processing:
double getPercentScore(const string ANSWERS, const string KEY); // return the percent score
// based on student answers and the key
char getGradeScore(const double PERCENT); // return the letter grade based
// the percent score
Screen INPUT (user)/OUTPUT (program) – should be formatted as follows (example using the provided testScores.txt file)
StudentID Answers % Score Grade
ABC123 TFTFTFTTTTFTFTFFTTF_ 95.0 A
AAB000 TFTTTFTTTT_TFTFFT_FT 82.5 B
ZZT090 TTTFFFTTTFFFTTTFFF__ 30.0 F
DOZ003 TFTFTFTTTTFFFFFFFFFF 62.5 D
DDC123 _FTFTFTTTTFTFTFFTTFT 95.0 A
Min score is 30.0% for Student ID ZZT090
Max score is 95.0% for Student ID ABC123
Average is 73.0%

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}