Back to 111 Main Page

Mobius strip

Assignment 7


Expand the Circle class so that it implements two interfaces.



Yet another version of wheels: intwheels.jar. This is coordwheels.jar with the addition of the two interfaces needed for this assignment.

Starting with the Circle from Assignment 6 (either your version or the provided solution), implement the two interfaces:

(These two files are already in the above .jar file. The source code provided here is just for your reference.)

Each of the two interfaces specify a single method that you will need to implement in Circle. The first part of your file will look like this:

package wheels.users;

import wheels.Scalable;
import java.awt.Color;
import java.awt.Dimension;

 * [your javadoc description of the class here,
 *  with @author and @version tags]
public class Circle extends Ellipse implements SquareShape, Scalable {

Once you have implemented the two interfaces, test them by replacing the main method in Circle with this one:

   * Tests a Circle by drawing a bull's-eye of 3 concentric circles.
  public static void main(String[] args) {
    Frame window = new Frame();

    //red outer circle
    Scalable outer = new Circle();

    //yellow middle circle
    SquareShape middle = new Circle();
    //XXX: unsafe casts if middle isn't really a RectangularShape
    ((wheels.Colorable) middle).setColor(Color.yellow);
    ((wheels.Locatable) middle).setLocation(350, 250);

    //green inner circle
    Circle inner = new Circle(375, 275, 50,;


What to Submit

Attach your file to an email.


Example code from lab?


Out of 10 points:

1 - Submission
Follows required submission policies.
2 - Coding standards
3 - Implements both interfaces
And builds on the previous version of Circle.
2 - Added methods are both correct
2 - Main method as given above

~ztomasze Index : TA Details: ICS111: Assignment 7
Last Edited: 10 Oct 2007
©2007 by Z. Tomaszewski.