Finish the Points, Rectangles, and Circles Exercise
begun in today's class. I.e. write the remainder of the Point,
Rectangle, and Circle methods described in the class handout.
Also write sufficient additional code to test the methods, and javadoc for everything.
Estimated time: 50-60 minutes if you are a student who
did well in 120 and are still confident about the Object-oriented material
from that course.
If you are very shaky on that material and find this assignment
difficult, you need to keep pressing on, get help as needed, and get
it done. I recommend for everyone that you start this
assignment during the first class period during which you do not
have class, so that you can scope out whether you are likely to need
help, and plan to go to the lab this afternoon or this evening.
If you find yourself spending more than 5 minutes on any method
(except possibly the intersects/intersection methods), you should
probably skip that method, move on and do some others, and come back
to the hard one if you get time later.There is one method that you are not required to do:
clone( ). And one
method that is trickier than I originally thought: the intersects(Rectangle r)
method of the Circle class. At first I was erroneously thinking that you only needed to check whether
the circle's boundingBox intersects the Rectangle. As you probably already know, that is
a necessary but not sufficient condition for intersection. But there are other things you must check also
One more note on intersects and intersection: I am
referring to intersections of the boundaries and/or interiors of the
rectangles, not just the boundaries. Thus if one rectangle
completely contains another one, we will consider them to intersect.