# Define the Circle2D class that contains: Two double data fields named x and y that specify the center of the circle with getter methods. A data field…

Define the Circle2D class that contains:

■ Two double data fields named x and y that specify the center of the circle with getter methods.

Haven’t Found The Relevant Content? Hire a Subject Expert to Help You With
Define the Circle2D class that contains: Two double data fields named x and y that specify the center of the circle with getter methods. A data field…

■ A data field radius with a getter method.

■ A no-arg constructor that creates a default circle with (0, 0) for (x, y) and 1

■ A constructor that creates a circle with the specified x, y, and radius.

■ A method getArea() that returns the area of the circle.

■ A method getPerimeter() that returns the perimeter of the circle.

■ A method contains(double x, double y) that returns true if the

specified point (x, y) is inside this circle (see Figure 10.21a).

■ A method contains(Circle2D circle) that returns true if the specified circle is inside this circle (see Figure 10.21b).

■ A method overlaps(Circle2D circle) that returns true if the specified circle overlaps with this circle (see Figure 10.21c).

Use the following code for the methods contains and overlaps:

public boolean contains(double x, double y) {

// MyPoint is defined in Exercise09_04

double d = distance(x, y, this.x, this.y) ;

}

public boolean contains(Circle2D circle) {

double d = distance(this.x, this.y, circle.x, circle.y);

}

public boolean overlaps(Circle2D circle) {

// Two circles overlap if the distance between the two centers

// MyPoint is defined in Exercise09_04

return distance(this.x, this.y, circle.x, circle.y)

}

private static double distance(double x1, double y1,

double x2, double y2) {

return Math.sqrt((x1 – x2) * (x1 – x2) + (y1 – y2) * (y1 – y2));

}

Here is a sample run for a point 2, 2 with a radius of 5.5:

I am attaching all files.

• Attachment 1
• Attachment 2

Why Hire a Professional Essay Writer from MyHomeworkGeeks

Quality Urgent Essays

Domyhomeworkk online platform provides the best essay writing service ever received elsewhere, thanks to our professional essay writers. Experience gained in the 10+ years of being in the assignment writing industry is also an added advantage.

A lot is done to maintain us as the best essay writing service provider. Besides owning a degree from a recognized university, a writer must pass the rigorous tests we take them through before they are considered eligible to offer urgent essay help on our website.

Affordable Urgent Assignment Help

Who said a reliable website should not be cheap also? While it is human nature to associate prices with quality, that does not always work. At domyhomeworkk.com, we guarantee you cheap and urgent essay help without compromising the quality.

24/7 Available Urgent Essay Writing Service

Whether it is a ‘write my essay for me cheap’ or ‘edit my essay’ order you want to request, always feel free to reach us at any time of the day. Our experts work in shifts to ensure that you access urgent essay writing services at any time of the day.

Plagiarism Free Essays Online

The punitive measures that come with plagiarized content are so harsh, and we understand that. We consequently ensure to write each client’s papers from scratch no matter how urgent the essay is. To acknowledge borrowed content, our quick writer references and cites the work.

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

## Calculate the price of your order

Total price:
\$0.00

How it works?

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Our Services

So much stress and so little time? Take care of yourself: let us help you with your tasks. We offer all kinds of writing services.

## Custom Essay Writing Services

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.