Question: import java.util.Scanner; class Main { public static void main(String[] args) { int x, y; Scanner input = new Scanner(System.in); // Prompt user for two coordinate

import java.util.Scanner;

class Main { public static void main(String[] args) {

int x, y; Scanner input = new Scanner(System.in);

// Prompt user for two coordinate values System.out.println("Enter x,y values of coord1 " + "(on the same line with a space between):"); //

// Create object coord1 // System.out.println("Enter x,y values of coord2 " + "(on the same line with a space between):"); // // Create object coord1 XYCoord coord2 = new XYCoord(x,y); //

// Displays the values of coord1 and coord2 by use // of the toString method, to appear EXACTLY as // follows: // coord1 has the value (x,x) // coord2 has the value (x,x) //

// Displays whether coord1 and coord2 are equal by // use of the equals method of the XYCoord class // to appear EXACTLY as follows: // "coord1 and coord2 are equal" or // "coord1 and coord2 are not equal" //

// Displays the distance between coord1 and coord2 // by use of the distance method of the XYCoord // class EXACTLY as follows: // "Distance between coord1 and coord2 = xx.xx" //

// Displays whether or not coord1 is within the // rectrangular area specified by (0,0) and (10,10) // by use of the withinArea method of the XYCoord // class EXACTLY as follows: // "coord1 within the area" OR // "coord1 not within the area" // } }Complete the code in java using the the above start code

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!