calculate sum and average of lines of number

Assuming a file contains a bunch of numbers, one number per line, like this:

One can easily calculate the sum and average of all these numbers, by using awk: