Average is calculated as the sum of the values divided by the number of values.
In A. you would add all the values and divide by 4 (the number of grades earned).
In B. You have to do a little algebra. Your formula to solve would be
80 = (88+78+86+x)/4
You would then solve for x