1. Engineering
  2. Computer Science
  3. define a class named circle a circle object stores a...

Question: define a class named circle a circle object stores a...

Question details

Define a class named Circle. A Circle object stores a radius and the (x, y) coordinates of its center point. Each Circle object should have the following public methods: . Circle (center, radius) .getCenter() .getRadius() . getArea() . getCircumference() Constructs a new circle with a center specified by the given Point and with the given integer radius. Returns the circles center Point. Returns the circles radius Returns the area occupied by the circle, using the formula ㎡ Returns the circles circumference (distance around the circle), using the formula 2π toString) Returns a string representation of the circle, such as CircleIcenter-(75, 20),radius-301 draw(g) Draws the circle onto a DrawingPanel, labeling its center point and drawing an outline of the circle itself. contains(p) Returns whether the given point lies inside the circle.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution