Added an input validation for the Calculator