if your grade average prior to the test was weighted equally to the test then your new grade is the arithmetic average = (91+71)/2 = 162/2 = 81
if they are weighted differently, such as the test counting twice as much, then
your new grade = [2(91)+71]/(2+1) = (182+71)/3 = 253/3 = 84.3 You need to calculate a "weighted average"
weight each grade, sum them, then divide by the sum of the weights
It's very similar to how they calculate your GPA, grade point average, although that's usually with letter grades with numbers between D=1 and A=4. But if they didn't use letters and you took a 4 credit course and got a 91, and a 3 credit course with a 71, your weighted average would be [4(91)+3(71)]/(4+3) = (364 +213)/7= 577/7 = 82 3/7 which is slightly larger than the simple average of 81, since the 91 counts more