Calculate Average

In this example I am calculating theAvg and then returning it using return. Note that I call the function within the write.