I am writing a program that keeps track of marks. However I noticed that there are a couple possible ways to calculate the mark and each one gives a different answer usually like 1% difference. So I want to check with some people to see which way is the proper way to go.
Here is some sample data( 2 assignments)
Mark: 80 - refers to the mark the student got on the given assignment/midterm/etc Out of: 90 - what the actual item was out of. weight: 86 - how much percent this given assignment/midterm/etc is worth to their final mark. This will always be out of 100. You can't get more then 100% in a course. Score: 80/90 = 88.89% achieved weight: 88.89% * 0.86 = 76.44%(this assignment was worth 86% of the 100%. This means all other assignments and stuff can only be worth a total of 14 to get a weight of 100%).
------- 2nd one below.
Mark: 85 Out of: 100 weight: 10 Score: 85/100 = 85% achieved weight: 85% * .10 = 8.5%
So those are 2 sample marks that this student got.
So 96% of the possible 100% for weight has now been give out. So the course has only 4% of unknown left.
Now I want to calculate the current mark and overallMark.
Current mark refers to the current mark the student has achieved by looking at assignments that have been actually marked.
So if the teacher has only given 2 assignments back and their weights are 10% each and this student got a 100% on both of these assignments then he is currently getting a 100% in the class. Of course if the student decided to drop out of the class then he would have gotten 20% in that class which also would be his overallmark since then you look at the total 100%.
Now a couple ways I found you can calculate the current mark are.
Total all the marks up and divide by total score
(80 + 85) / (90 + 100) = 165 / 190 = .868 * 100 = 86.84%
Total all the marks up and divided by number of tasks. Basically getting average. (80 + 85) / 2 tasks = 165/ 2 = 84%
add up all achieved weights 76.44 + 8.5 = 84.94%
add up all total marks up divide by total score times times by achieved weight (80 + 85) / (90 + 100) = 165 / 190 = .868 * 96 = 83.32%
For overall %
- Add up all achieved weights and divide by a 100 ( 76.44 + 8.5 ) /100 = 84.94%
So as you can see I found many ways to do this. I am not sure really what the best way or the correct way is. I think number 3 would get me the most accurate result but I want to double check with people. I don't want to be off by 1-2% since that could mean that my application is telling them that they could be failing when they are passing or getting an A when they really are getting a B.
P.S I have no clue what tags to put on for this question.