1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#include <iostream>
using namespace std;
int main()
{
const int num_questions=20;
int userval[num_questions];
int count; // loop counter
cout<<"automated grader,, please enter in testees grades"<<endl;
cout<<"remember use caps only"<<endl;
cout<<endl;
for (count=0; count <num_questions; count++)
{
cout<< "enter the answer to question "<<(count + 1)<< " : ";
cin>> userval[count];
}
int n1 = 65;
int n2 = 66;
int n3 = 67;
int n4 = 68;
int answers[]={n2,n4,n1,n1,n3,n1,n2,n1,n3,n4,n2,n3,n4,n1,n4,n3,n3,n2,n4,n1};
for (count=0; count <num_questions; count++)
{
if(userval[count]!=answers[count])
cout<<"you got the question "<<count+1<<" wrong. correct4 answer is "<<answers[count]<<endl;
}
return 0;
}
|