Try It Yourself: ifs

Suppose we have a Circle class with the following methods:
public Circle(Point centerPt, double r) constructs a circle with the given center point and radius
public Point getCenter() returns the Point center point of the circle
public double getRadius() returns the double radius value of the circle
public void setRadius(double newR) sets the radius to the value given
public void setCenter(Point newCenter) sets the center point to the point given
public double computeArea() returns the double area of the circle
public double computeCircumference() returns the double circumference of the circle

  1. Write the contains method for the Circle class. The method should take a Point as an argument and return true if the given point is inside the circle and false otherwise.
  2. Write a method isInside that takes two Circle objects as arguments and returns true if the second circle is completely inside the first circle and returns false otherwise. That is, the isInside method should have the following signature:
    boolean isInside(Circle outer, Circle inner)