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
Get step-by-step solutions from verified subject matter experts
