Question: Fix the errors to run the program. import java.lang.System; import java. lang.String; import java.lang.Math; 7import java.util.scanner; 8| L mport javafx.geometry.Point2D; 9 10 11 public class


Fix the errors to run the program.
import java.lang.System; import java. lang.String; import java.lang.Math; 7import java.util.scanner; 8| L mport javafx.geometry.Point2D; 9 10 11 public class FindNearestPoints2D t 12 public static void main(String[] args) { 13 Scanner input new Scanner(System.in); 14System.out.print("Enter the number of points: "); 15int numberOfPoints input.nextInt); 16 Point2DIl points new Point2D [numberOfPointsl; 17 System.out.print("Enter"+ numberOfPoints +"points: ") 18| | 19 20 21 for (int i-0; Distance) t shortestDistance Distance: System.out.print ln("The closest two points are" + "(" + pointsliJ.x " pointsli].x points(1). + ", " + points [1]. + ")"); and (" + public static double distance(double x, double y, double x1, double y1) f return Math.sqrt( (xi - x) (x1 x) + (yl y) (yl y))i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
