Sep-11-2020, 12:33 PM
Though you get the correct answer for a student's weighed average this is only because the sum of the weights is 1. Try changing your weights to [10, 10, 30, 25, 25]. This should compute the same weighted average as [0.1, 0.1, 0.3, 0.25, 0.25] but it does not when run in your program.
Fixing the above problem should point out the error you are making calculating the classroom average.
Fixing the above problem should point out the error you are making calculating the classroom average.