Original study example
Three measured temperatures are 18, 20 and 22 °C. Plan a program to calculate their mean, and decide how it should handle an empty set of measurements.
Work through the example
Add the three observations and divide by their count: 60/3 = 20 °C. Keep the unit with the result. An empty set needs an explicit missing-data response rather than division by zero. Separate that case from a genuine measurement of zero.