Question: Grading like a Scantron Input the Key to the test, then input the student answers to the test. Compare and grade the results using C=Correct

Grading like a Scantron

Input the Key to the test, then input the student answers to the test.

Compare and grade the results using C=Correct and W=Wrong

3 arrays are all you need!

Very much like this

Key A B C D A B C D A B C C A B C D A B C D

Answers A A C A A B C D A B C D A B B D A B C D

C/W C W C W C C C C C C C W C C W C C C C C

Percentage Correct = 80%

//System Libraries #include //Input/Output Library #include //File I/O #include //String Library using namespace std;

//User Libraries

//Global Constants, no Global Variables are allowed //Math/Physics/Conversions/Higher Dimensions - i.e. PI, e, etc...

//Function Prototypes void print(const string &); void read(const char [],string &); int compare(const string &,const string &,string &);

//Execution Begins Here! int main(int argc, char** argv) { //Set the random number seed //Declare Variables string key,answers,score; char fileKey[]="key.dat",fileAns[]="answer.dat"; float pRight; //Initialize or input i.e. set variable values read(fileKey,key); read(fileAns,answers); //Score the exam pRight=compare(key,answers,score); //Display the outputs cout<<"Key ";print(key); cout<<"Answers ";print(answers); cout<<"C/W ";print(score); cout<<"Percentage Correct = "<

//Exit stage right or left! return 0; }

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