I tried the scanner class before but my loop never executed properly. I changed the code as you suggested, and it works, here is the changed code:
but the output when supplied with a string instead of a integer is the following:
Enter integer: gdf
ERROR: Only a integer is a valid input
The square root of 0 is 0
Do you want to continue? (y / n):
When the input is a string, I do not want the statement
to be executed but jump over to the print statement of
instead. How would some kind of if statement look like to check if this error has occurred and the jump over the
The square root of:
statement