Faculty of Engineering

SEG 2105 Assignment 2

For details of other assignments and general rules, see this page.

For the due date see the course syllabus

This is an individual assignment. You must work strictly alone on this.

Hand in answers to the following. Note that some of the material comes from chapter 2 and some from the very start of chapter 5. It is suggested that you do the questions from chapter 2 first, then work on the problem from chapter 5 as the deadline nears

It is suggested that you use Umple for the inheritance hierarchies and class diagram.

  1. From the 2DShape Hierarchy on slide 22 of the Chapter 2 notes:

    a) If you have a variable of type Polygon and you call the method getVertices, in what class or classes are the methods that might be invoked?

    b) If you have a variable of type EllipticalShape and there is a Circle object in it, and you call the method translate, in what class or classes are the methods that might be invoked?

  2. Add the following classes to the 2DShape class diagram. For each, indicate its superclass, attributes and methods.

    If you would need to insert another class or change an existing class, then specify this.

  3. Create a simple class diagram for the following classes. Add superclasses as necessary, and feel free to change the names of the following classes. Add necessary attributes.