Answer to Question #314353 in Java | JSP | JSF for mahesh

Question #314353

Create a class Point2D , in package-"p1":for representing a point in x-y co-ordinate system. Create a parameterized constructor to init x & y co-ords. Add a method to return string form of point's x & y co-ords

(Hint:public String getDetails())

Add isEqual method to Point2D class :a boolean returning method : must return true if n only if both points are having same x,y co-ords or false otherwise.

Add calculateDistance method to calculate distance between current point and specified point & return the distance to the caller.

(Use distance formula . Use java.lang.Math class methods-sqrt, pow etc)

Write TestPoint class , in package "p2" , with a main method, Accept co ordinates of 2 points from user (Scanner) to create 2 points (p1 & p2)

Use getDetails method to display point details.(p1's details & p2's details)

Invoke isEqual & display if points are same or different

If they are not located at the same position , display distance between p1 & p2


0
Service report
It's been a while since this question is posted here. Still, the answer hasn't been got. Consider converting this question to a fully qualified assignment, and we will try to assist. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS