Revised the code to give an error message if a decimal number is provided by the user