Image

Imageworldsoutro wrote in Imagecpp

getting an average out of a two dimensional array

hi,

My teacher gave me code to alter this is what it does.

asks for how many students in the first class. I entered two for test example

than asks user to enter grades for those two users

then asks how many in second class. Again after enter grades for x amount of students


After i enter the grades it spits out what i inputed for grades.


Now my question is, my teacher wants me to get an average of each class?? I know i will need to make a funcation and use it in a for loop. I don't know how i would go about doing this??


Could somone please give me an example of getting an avergae out of a two dimensional array??


thank you