Question: Exercise 1 Create a file named A5.java. Place all your code in this file. You will be using the java.awt.Point class for this lab. Create

Exercise 1

Create a file named A5.java. Place all your code in this file. You will be using the java.awt.Point class for this lab.

Create a public static method named getDistance that takes as input 2 Point objects. The distance between 2 points is calculated as (21)2+(21)2. Calculate the distance between the 2 points and return the result as a double.

Exercise 2

Create a public static method named updatePoint that takes as input a Point and two integers, x and y. Update the x and y coordinates of the point object to the parameters x and y. Return the Point object.

Note: Do not create a new Point object.

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!