Refactored arithmetic.php to check for certain input and echo error messages using a function