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
//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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started