Any help plz !

http://ideone.com/MIV4h4

The grades is given out of 100 and it have to be out of 20
I faced a little problem with the percentages ?. any body know where ? cause I couldn't find it.

Thanks a lot
HWs / total is equals to 0 due to integer division.
Use (static_cast<double>(HWs) / total) here and in similar cases.
Oh thanks it works but still have problem the input should be
90 70 81 90
20 20 20 40
the output should be
18 + 14 + 16.2 + 36 = 84.2

However the total shown in my program is 331. What is the process here ? very confusing.
The formula is:

1
2
for (int i = 0; i < NUM_GRADES; ++i)
  total += grade[i] / 100.0 * weight[i];


where the weights need to add up to 100.
Topic archived. No new replies allowed.