simple java task

Get perfect grades by consistently using our affordable writing services. Place your order and get a quality paper today. Take advantage of our current 20% discount by using the coupon code GET20


Order a Similar Paper Order a Different Paper

For this task you have to define a class Circle2D to represent a circle with a point in two dimensions labelled x and y and a radius. To test Circle2D class you also need to define a test class. The Circle2D class has the following state and functionality:

  • Two double data fields named x and y that specify the centre of the circle with getter methods.
  • A data field radius with a getter method
  • A no-arg constructor that creates a default circle with (1, 1) for (x, y) and 4 for radius.
  • A constructor that constructs 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
  • A method contains(Circle2D circle) that returns true if the specified circle is inside this circle

Draw the UML diagram for the class and then implement the class. Write a test class program that creates a Circle2D object c1(new Circle2D(3, 3, 2.5)), display its areas and perimeter, and display the result of c1.contains(3,3) and c1.contains(new Circle2D(4, 5, 8.5)).

Have your paper completed by a writing expert today and enjoy posting excellent grades. Place your order in a very easy process. It will take you less than 5 minutes. Click one of the buttons below.


Order a Similar Paper Order a Different Paper