Problem

Deffine a class named Circle that is derived from this API superclass:java.awt.geom.Ellips...

Deffine a class named Circle that is derived from this API superclass:

java.awt.geom.Ellipse2D.Double

See Exercise 6 for a brief description of this Double superclass. Your subclass should declare the two private instance variables, xCtr and 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 3-parameter constructor whose parameters are the x- and y-distances to the circle’s center and the circle’s diameter. This 3-parameter constructor should not only initialize the new instance variables but also use the 4-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.

Step-by-Step Solution

Request Professional Solution

Request Solution!

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.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 12
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT