Calculate Average

You should note that when I define theAvg using var this does not work because theAvg in the body does not see it. That is because variables defined within a function are local. If you define them outside the function they are global. Omitting the word var gets around this but is not considered a great coding technique.