Numerical solution of the Euler equations by the weighted average flux method: part I