average marks function defined