Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need the solution for 10.11 in Introduction to Java Programming, Comprehensive

ID: 3637062 • Letter: I

Question

I need the solution for 10.11 in Introduction to Java Programming, Comprehensive, 8/e. I have this so far:
public class Exercise10_11 {
public static void main(String[] args) {
Circle2D c1 = new Circle2D(2, 2, 5.5);
System.out.println("Area is " + c1.getArea());
System.out.println("Perimeter is " + c1.getPerimeter());
System.out.println(c1.contains(3, 3));
System.out.println(c1.contains(new Circle2D(4, 5, 10.5)));
System.out.println(c1.overlaps(new Circle2D(3, 5, 2.3)));
}
}

class Circle2D {
I can't think of how to write this next class.
}

Explanation / Answer

Please Rate: Thanks public final class Circle2d{/** Circle's coordinates. */private double x, y;/** Circle's radius. */private double r;/*** Creates instance of {@link Circle2d} class with specified circle's* central point and radius.** @param circleX - 'x' coordinate of circle's central point.* @param circleY - 'y' coordinate of circle's central point.* @param radius - circle's radius.*/public Circle2d(double circleX, double circleY, double radius){setCircle(circleX, circleY, radius);}/*** Creates instance of {@link Circle2d} class using coordinates* from specified {@link Circle2d} object.** @param circle - the specified {@link Circle2d} object.*/public Circle2d(Circle2d circle){setCircle(circle.x, circle.y, circle.r);}/*** Sets the location of the circle's central point and radius to the specified* values.** @param circleX - 'x' coordinate of circle's central point.* @param circleY - 'y' coordinate of circle's central point.* @param radius - circle's radius.*/public void setCircle(double circleX, double circleY, double radius){x = circleX;y = circleY;r = radius;}/*** Gets the 'x' coordinate of this circle.** @return Returns the 'x' coordinate of this circle.*/public double getX(){return x;}/*** Gets the 'y' coordinate of this circle.** @return Returns the 'y' coordinate of this circle.*/public double getY(){return y;}/*** Gets the radius of this circle.** @return Returns the radius of this circle.*/public double getRadius(){return r;}/*** Checks whether this circle contains specified point.** @param pointX - 'x' coordinate of the checked point.* @param pointY - 'y' coordinate of the checked point.** @return Returns true if this circle contains specified point,* false otherwise.*/public boolean contains(double pointX, double pointY){return contains(this, pointX, pointY);}/*** Checks whether this circle contains specified point.** @param point - checked point.** @return Returns true if this circle contains specified point,* false otherwise.*/public boolean contains(Point2d point){return contains(this, point.getX(), point.getY());}/*** Checks whether the specified circle contains the specified point.** @param circle - the specified circle.* @param pointX - 'x' coordinate of the checked point.* @param pointY - 'y' coordinate of the checked point.** @return Returns true if specified circle contains* specified point, false otherwise.*/public static boolean contains(Circle2d circle, double pointX, double pointY){double dx = pointX - circle.x;double dy = pointY - circle.y;return (Math.sqrt((dx * dx) + (dy * dy))
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote