Computer Science Programming Code
Description
The history teacher at your school needs help in grading a True/False test. The students Ds and test answers are stored in a file. The first entry in the file contains answers to the test in the form: TFFTFFTTTTFFTFTFTFTT The remaining entries in the file (historyStudentTestAnswers.dat) is the student ID, followed by a space, followed by the studentàresponses. 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. The exam has 20 questions, and the class has 10 students enrolled. Each correct answer is awarded two points, each wrong answer gets one point deducted, and no answer gets zero points. Write a program that processes the test data. The output should be the studentàID, followed by the answers, followed by the test score, followed by the test grade to a file called historyStudentTestGraded.dat. Assume the following grade scale used in this class (refer to the COSC 113.556 course syllabus).
Your program must use the three (3) functions listed below. Be sure to use the function implementation method established in class.
Functions the program must include:
- printStudentData: This function takes an output file reference, a 1-D string array, a 2-D character array, 1-D array float, and the integer for the number of rows. The function should display the student test information as follows: Student ID: ABC54301 Test answers: TFTFTFTT TFTFTFFTTFT === Score: 10 out of 40 === Grade: F
- initStudentData: The function takes as an input file reference, a 1-D string array, a 1-D character array (hint: the answer key), a 2-D character array, and the integer for the number of rows. The function should initialize the contents of each array structure accordingly. The first line of in the file corresponds to the answer key. The next set of input lines are laid out as follows: the student ID and their corresponding test answers.
- calculateTestScore: The function takes a 1-D character (hint: the answer key), 1-D array of type float, and a 2-D character array. The function calculates each students test score by comparing each answer entered by the student against the answer key. Each correct answer is awarded two points, each wrong answer gets one point deducted, and no answer gets zero points.
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."