second excersize also ready: average.cpp