make calculateLastOperator function throw ArithmeticException as well