Create a thing that can be offered numbers.
At any given time it can tell 3 things:
- the smallest number it has encountered so far
- the largest number it has encountered so far
- the average of all numbers it has encountered so far
Prove that it is working correctly. Make it so that a novice programmer cannot use it the wrong way, nor that an evil programmer can break it.