Class Progress Computation

24 Views Asked by At

I am making a program where I need to include the progress of an entire class based on the number of lessons they have taken versus the number of lessons available. I understand that for a single student, the formula is number of lessons taken divided by the total number of lessons times 100.

How do I compute for it in a class level?

Please take note that some students might be ahead of their classmates in answering lessons.

1

There are 1 best solutions below

5
On BEST ANSWER

You could label the progress of each student as $x_1,x_2, ..., x_n$, and the number of lessons each student has taken as $y_1,y_2, ..., y_n$ with $x_i = \frac{y_i}{total number of lessons} * 100$ for student i, and n being the number of students in the class. The average would be simply $\frac{\sum_{i=1}^n x_i}{n}$, where $\sum_{i=1}^n x_i = x_1 + x_2 + ... + x_n$

Hope this helps.