does anyone have a suggestion?
import java.util.Scanner;// program uses class Scanner
public class DistanceMethod
{
// Main method begins execution of Java application
public static void main( String args[] )
{
// create scanner to obtain input from the command line
Scanner input = new Scanner( System.in );
double x1;
double x2;
double y1;
double y2;
double distance;
distance = Math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
System.out.print( "Enter the the coordinates for x1");// Prompt
x1 = input.nextInt(); // Read the number for x1
System.out.print( "Enter the the coordinates for x2");// Prompt
x2 = input.nextInt(); // Read the number for x2
System.out.print( "Enter the the coordinates for y1");// Prompt
y1 = input.nextInt(); // Read the number for y1
System.out.print( "Enter the the coordinates for x2");// Prompt
y2 = input.nextInt(); // Read the number for y2
System.out.print( "The distance between the two points are" + distance);
}
}
*please use code tags:

New Topic/Question
This topic is locked




MultiQuote








|