Hello. I am doing a java excercise where I have to determine if two circles with input centers and radii intersect.
the form I use for inputing each parameter is:
Scanner input = new Scanner(System.in);
System.out.print("Please input the x coordinate of the first circle: ");
double x1 = input.nextDouble();
System.out.print("Please input the y coordinate of the first circle: ");
double y1 = input.nextDouble();
I have used all the necessary imports and declarations and the program compiles fine. It works well, but only if I input integers, however when I input a decimal point number, terminal returns:
at java.util.Scanner.throwFor(Scanner.java:819)
at java.util.Scanner.next(Scanner.java:1431)
at java.util.Scanner.nextDouble(Scanner.java:2335)
at threeDotTwentyNine.main(threeDotTwentyNine.java:10)
I have tried compiling this with float too and that returned a similar error.
Any suggestions on how to fix this?
the form I use for inputing each parameter is:
Scanner input = new Scanner(System.in);
System.out.print("Please input the x coordinate of the first circle: ");
double x1 = input.nextDouble();
System.out.print("Please input the y coordinate of the first circle: ");
double y1 = input.nextDouble();
I have used all the necessary imports and declarations and the program compiles fine. It works well, but only if I input integers, however when I input a decimal point number, terminal returns:
at java.util.Scanner.throwFor(Scanner.java:819)
at java.util.Scanner.next(Scanner.java:1431)
at java.util.Scanner.nextDouble(Scanner.java:2335)
at threeDotTwentyNine.main(threeDotTwentyNine.java:10)
I have tried compiling this with float too and that returned a similar error.
Any suggestions on how to fix this?