you will write two java files for this assignment: circle.java, and main.java. the circle.java file is the primary interest. it will create an actual class, the first one that we have written this semester. the circle class is similar to the rectangle class from the reading. the circle class should meet these criteria:

Respuesta :

Areas of Circles C1 and C2 are 78.54, 452.39, and 314.16 respectively. The overlap between circles c1 and c2 is true, but the overlap between circles c2 and c3 is false.

What is Java, exactly?

Millions of devices, including laptops, smartphones, gaming consoles, medical equipment, and many more, employ the device programming language and technology platform known as Java. Java's syntax and principles are derived first from C and C++ programming languages.

Briefing:

**Code is given below**

//Circle.java

class Circle

{

private double x,y,radius;

void setX(double value){this.x=value;}    

double getX(){return this.x;}    

void setY(double value){this.y=value;}    

double getY(){return this.y;}

void setRadius(double value){this.radius=value;}    

double getRadius(){return this.radius;}

double getArea(){return Math.PI*Math.pow(this.radius,2);}

boolean doesOverlap(Circle otherCircle){

double distance,radius_sum;

radius_sum=this.radius+otherCircle.radius;

distance=Math.sqrt(Math.pow((this.x-otherCircle.x),2)+Math.pow((this.y-otherCircle.y),2));

if(radius_sum>=distance){return true;}

else{return false;}

}

}

//CircleTester.java

public class CircleTester{

public static void main(String[] args){

Circle c1=new Circle();

c1.setX(8);

c1.setY(-6);

c1.setRadius(5);

Circle c2=new Circle();

c2.setX(2);

c2.setY(3);

c2.setRadius(12);

Circle c3=new Circle();

c3.setX(15);

c3.setY(28);

c3.setRadius(10);

System.out.printf("Circle c1 Area: %.2f",c1.getArea());

System.out.printf("\nCircle c2 Area: %.2f",c2.getArea());

System.out.printf("\nCircle c3 Area: %.2f",c3.getArea());

System.out.println("\n\nCircles c1 and c2 Overlap: "+c1.doesOverlap(c2));

System.out.println("Circles c2 and c3 Overlap: "+c2.doesOverlap(c3));

}

}

**Code ended**

To know more about Java visit:

https://brainly.com/question/26789430

#SPJ4

The complete question is-

Circle Class: Java program

You will write two java files for this assignment: Circle.java, and CircleTester.java.

The Circle.java file is the primary interest. It will create an actual class, the first one that we have written this semester. The Circle class is similar to the Rectangle class from the reading.

The Circle class should meet these criteria:

Three member fields

double radius

double x

double y

Eight methods:

Six of the methods are simple: getter’s and setter’s for x, y, and radius.

There should also be a getArea method that returns the area (derived from the radius)

A doesOverlap method. This method should accept a Circle as an argument, and return true if this circle overlaps the circle that the method was invoked on. [Note: two circles overlap if the sum of their radius' is greater than or equal to the distance between their centers.]

The reading this week discusses one of the UML diagrams. Here is the diagram for the Circle class:

Circle Class

double x

double y

double radius

void setX(double value)

double getX()

void setY(double value)

double getY()

void setRadius(double value)

double getRadius()

double getArea()

boolean doesOverlap(Circle otherCircle)

CircleTester:

Write a second class named CircleTester. It should be in its own file named CircleTester.java. It should contain code that tests your Circle class. It should have a static main method, and if you want you can put all of the code inside that main method.

After you have tested the code to your own satisfaction, submit code that meets these minimum criteria

Allocate and initialize at least three Circle objects. Two of them should overlap, and two should not.

Display the areas of the three circles

Invoke doesOverlap on Circles to show which circles overlap.

Submit two files, inside a compressed folder. Circle.java and CircleTester.java