calculates the batting and base average