Are you intentionally doubling a student's final grade? That will make the actual average be higher than you expect.
Also, the classaverage line specifically sets classaverage to 0/3, which equals 0, every time you go through the loop.
You're right. Thank you very much for your help!