Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone answer the questions and explain why that is the answer. The Point Class l The Application (client) Program I/ Point class public class

Can someone answer the questions and explain why that is the answer.

image text in transcribed

image text in transcribed

The Point Class l The Application (client) Program I/ Point class public class Point implements Compaiable Point? public class PointTest privale double myx; private double myY publ'c static void ma n(Strnglargs) Point point1 Point point2; double distance; public Point) myx 0.0 myY = 0.0; coint1 new Point(5,6); r.oint2 new Point(-1,3); distance- point1.findDIstanceTo(point2): rublic Point double thex, double theY) sotPoint(thoX, the): System.out.printThe d'stance from+ pont1to"po'nt2); System-outprint(" is %.3Rna, distance): public double getx) return myX 1 ublic double getYo eturn myY publ'c Strng toString0 public double findDistanceTo(Point other) double ans, xDist, yDist; xDist-this.getx) -other.getXO: yDist this.getY- other getY); ans Math.sqrt(Math.pow(xDist,2) Math.powlyDist.2)) return ans; public void setPolnt(double x, double y) myx rublic int compaieTo(Point othet) return 0; I to be completed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions