CMPUT 301

Software Engineering

Class Participation Exercise (Code to UML)


Class Participation Exercise

Consider a Rect class to represent a rectangle in a two-dimensional integer plane.

public class Shape {
    protected Location myLocation;
    public Shape() { ... }
    public void setLocation( Location p ) { ... }
    public Location getLocation() { ... }
}

public class Square extends Shape {
    private int side;

    public Square() { ... }
    public void setSide( int s ) { ... }
}

Document this Java code by expressing its design in a corresponding UML class diagram.

Submit the diagram as a PNG or JPG or PDF file.

(For this exercise, the diagram can be hand drawn on paper, with a picture of it submitted as the file.)