Problem Statement
A class of 20 students has average score 70. Another class of 30 students has average 80. What is the combined average?
Explanation
Use weighted average. Total sum equals twenty times seventy plus thirty times eighty equals one thousand four hundred plus two thousand four hundred equals three thousand eight hundred. Divide by total fifty to get seventy six.
Code Solution
SolutionRead Only
avg = (20×70 + 30×80)/(20+30) = 3800/50 = 76
