Can anyone tell me why I am getting this message:
"...error C2296: '%': illegal, left operand has type 'double' "
here is my code:
double Q1median(ifstream& students, string studentid[60], string fname[60], string lname[60],
int Q1[60], int Q2[60], int Q3[60], int MidTerm[60], int Q4[60], int Q5[60],
int Q6[60], int Final[60],int i)
{
double sum1,Q1median;
int cnt;
sum1 = 0.0;
cnt = 0;
for (i=0; i<6; i++)
{
Q1[i]; sum1+=Q1[i];
cnt++;
if ((sum1 % 2) == 0)
{
Q1median = sum1/cnt;
}
else
{
Q1median = ((sum1 -1)/cnt) - 1;
}
}
return Q1median;
}