Question: fix the error in the following Java code. import java.util.Scanner; public class CoordinateGeometry { public static void main ( String [ ] args ) {

fix the error in the following Java code. import java.util.Scanner;
public class CoordinateGeometry {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
double x1;
double y1;
double x2;
double y2;
double pointsDistance;
double xDist;
double yDist;
pointsDistance =0.0;
xDist =0.0;
yDist =0.0;
x1= scnr.nextDouble();
y1= scnr.nextDouble();
x2= scnr.nextDouble();
y2= scnr.nextDouble();
pointsDisctance = Math.sqrt(Math.pow((x2- x1),2)+ Math.pow(y2- y1),2));
System.out.println(pointsDistance);
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!