Question: public class turtle{ public static void main(String[] args){ World mars = new World(200,300); Turtle joe = new Turtle(mars); joe.forward(); }//end main }//end class Using the

public class turtle{ public static void main(String[] args){ World mars = new World(200,300); Turtle joe = new Turtle(mars); joe.forward(); }//end main }//end class 

Using the above example for the "turtle class" game that allows you to move a turtle around by issuing commands like stated above,

Modify the Turtle class so that it has the methods drawRectangle, drawHexagon, and drawPentagon. These methods should each be parametized. In order words, drawRectangle should be passed the width and height, and drawHexagon and drawPentagon should be passed the length of the sides. Each method should perform the action that their name suggests.

The assignment also requires that there be another method that "does anything that is interesting," so be creative! Thank you!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!