I can see why you would think to do it that way, but the correct way to calculate the average is total score/ total number of students.

So for the juniors, let be their total score. Then we know that

For the seniors, let be their total score. Then similarly

So the correct average for the 50 students as a whole is

hope this helps,

pomp.