CIS 3020 Project 1
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:
- 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: - rectangle(length: double, breadth: double) draws a rectangle.,
- pentagon(length: double) draws a regular pentagon,
- hexagon(length: double) draws a regular hexagon,
- octagon(length: double) draws a regular octagon,
- square(length: double) draws a regular square, and
- a driver class, DrawHouse( ), that draws the house given in the figure below.