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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started