updated Calc.java in Compilation 3