The local Penn DOT Office needs a program to grade the written portion of the dr
ID: 3660008 • Letter: T
Question
The local Penn DOT Office needs a program to grade the written portion of the driver's test. Student's take this test upon completing the classroom portion of driver's exam. The exam has 20 multiple choice questions. The correct answers are: Your program should Store the correct answer in an array Read the answers for a student from a file driving.dat and store them in a parallel array Compare each entry in the correct array and student array, and store a boolean value (true/false) in a third array. If the answer is correct, store true in the third array. If the answer was incorrect, store false. Use one or more functions that takes the third array as parameter and find or prints the number of correct answers, the number of incorrect answers, a list of numbers for the questions missed Use another function to find whether the student passed (15 or more correct) Write out a table with one line for each student. For each student it should report the number of correct answers, the number of incorrect answers, a list of the numbers for the questions missed and whether or not the student passed. The table should have headings for the columns.|Explanation / Answer
#include #include #include #include using namespace std; void calcStats(bool[],int&,int&,int[]); bool PassedTest(int); int main(){ char student[20]; char correct[20]={'B','D','A','A','C','A','B','A','C','D','B','C','D','A','D','C','C','B','D','A'}; bool match[20]; int Right,wrong, WrongList[20]; bool passed; int studentCount=0; char temp; ifstream infile("driving.dat"); //close out program if file failed to open if(!infile.is_open()){ coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.