BJP3 Exercise 3.11: distance
Write a method called
distance that accepts four integer coordinates x1, y1, x2, and y2 as parameters and computes the distance between points (x1, y1) and (x2, y2) on the Cartesian plane. The equation for the distance is:
For example, the call of
distance(1, 0, 4, 4) would return
5.0 and the call of
distance(10, 2, 3, 5) would return
Method problem: For this problem, you are supposed to write a Java method as described. You should not write a complete Java class; just write the method(s) described in the problem statement.
Contacting server and running tests...
Is there a problem?
Contact a Practice-It administrator.