CIS 3020 Project 1

From In The Wings
Revision as of 10:45, 30 March 2007 by Jka (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Background

We have discussed the class Turtle and Island in class and in Lab sessions. In this homework you will focus on getting acquainted with extending a class to add more functionality. You have been given the UMLs for the two classes in your lecture notes. Your job is to augment the Turtle class by creating a new subclass called GeometricTurtle that contains at least the following methods:

  1. drawSide(length: double, angle: double) draws the side of an object of the specified length, then turns the specified angle.
    Using this drawSide method you will implement the following methods:
  2. rectangle(length: double, breadth: double) draws a rectangle.,
  3. pentagon(length: double) draws a regular pentagon,
  4. hexagon(length: double) draws a regular hexagon,
  5. octagon(length: double) draws a regular octagon,
  6. square(length: double) draws a regular square, and
  7. a driver class, DrawHouse( ), that draws the house given in the figure below.