Define a class named
Circlethat is derived from this API superclass:
java.awt .geom.Ellipse2D.Double
See Exercise 6 for a brief description of this
Doublesuperclass. Your subclass should declare the two
privateinstance variables,
xCtrand
yCtr,initialized to 0.0. These variables are the x- and y-coordinates of the circle’s center. Your class should include a zero-parameter constructor, and it should also include a three-parameter constructor whose parameters are the x- and y-distances to the circle’s center and the circle’s diameter. This three-parameter constructor should not only initialize the new instance variables but also use the four-parameter constructor of the superclass to initialize the four instance variables in the superclass. Your class should also provide the following accessor methods:
getXCtr, getYCtr,and
getRadius,where the radius is half the height of the superclass shape. Verify the code you write by compiling it and running it with representative values for x-center, y-center, and diameter.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.