Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a class called Point that has the following: Integers x and y that represent the x and y coordinates of the point. Constructors and
Create a class called Point that has the following: Integers x and y that represent the x and y coordinates of the point. Constructors and other basic methods Method distanceFrom(Point another) that returns the distance of this point from another point. (Note: Given the two points (xi. yi) and (xi, V2), the distance between these points is given by the formula: Test your methods using a client program with a main method. Next create a class called Circle that has the following. Attributes: Center of the circle (a Point) and radius (double)- A no-arg constructor that creates a default circle with (0,0) as center and 1.0 as radius.+ A constructor that creates a circle with the specified center and radius.-' A method getArea that returns the area of the circle. A method getPerimetea) that returns the perimeter of the circle.v A method contains(Point p) that returns true if this circle contains a point p (see Figure 1).* A method touches Point p) that returns true if this circle touches a point p (see Figure 2). A method contains(Circle c) that returns true if the specified circle is inside this circle (See Figure Test all methods using a client program with a main method (you should have at least 3 tests and make sure that you include all the three cases as shown in the figures below).v Figure 1 Figure 2 Figure 3- Hint: You can determine if a point is inside a circle by the following procedure
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