Solution(in words)
Check if we reached the End-Of-File immediately. If so, print a message and exit.
If not at the end of file, initialize the count to 1, and max, min, sum, sum of squares by the value just read.
Set up a loop to read a value, and then
- Count it.
- If it is larger than any value seen so far, we record it as new high.
- If it is smaller than any value seen so far, we record it as a new low.
- We add to the sum.
- We add the square to sum of squares
After reading all values, we compute the mean, variance, and standard deviation and print the statistical summary.