Quick Index
Problem Statement


This challenge follows the examples.

Our challege is to code Point, Circle and Ellipse so that we can run our graphics system.

First download this code into your working directory.

Then follow the instructions below for coding the three classes.

Point


Point is the core object in graphics. And we've already coded most of it!


Circle


Circle is a composite -- i.e. it is made up of component(s). In it's case, it has a "Point" child.

Circle.java is started for you.

Add These Private Ivars:


Code:


Running The Grahics System


Once Circle is finished and compiling okay you can fire up the graphics system.

One way is in the console, in your working directory:

">javac GraphicsApp.java
>java GraphicsApp"

If you hit "Go" that will kick off the graphics. And hitting "Randomize" will change things up.

Ellipse


Ellipse is a composite -- i.e. it is made up of component(s). In it's case, it has a "Point" child.

Ellipse.java is started for you.

Add These Private Ivars:


Code:


To activate Ellipse (rather than Circle) you can tweak the constructor in "OuterSpace" (uncomment the Ellipse line). Then fire up the graphics system again.