Question: We use drjava and draw with turtle graphics. The question asks as follows; Write a Java program to that draws a spiral of polygons as
We use drjava and draw with turtle graphics. The question asks as follows;
Write a Java program to that draws a spiral of polygons as shown below:

Write a method: private void drawPolygon ( int numEdge, int edgeLength ) { which will draw a polygon (regular n-sided figure) with numEdge sides and edge length of edgeLength. The first edge is drawn from the turtle position in the turtle direction. Subsequent edges are drawn at a rotation of 2 where n is the number of sides. Write another method: private void drawSpiral ( int num ) { which draws num polygons of increasing number of edges and side length of 5. The first polygon has 10 sides and is drawn in the current turtle direction. Each successive polygon has 10 more edges than the previous and is drawn at an angle of 2um from the angle of the previous. The constructor should use drawSpiral to draw a polygon spiral with 10 polygons.
Turtle Displayer File Help Turtle Canvas: Angle: 0 Location: (0, 0) Pen is: Up Pen ColouriPen Width: 1 Close Turtle Displayer File Help Turtle Canvas: Angle: 0 Location: (0, 0) Pen is: Up Pen ColouriPen Width: 1 Close
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
