Question: Javas class Graphics2D extends the Graphics class has the following method to draw a shape: public void draw(Shape). java.awt.geom.Line2D.Double implements the Shape interface and represents

Javas class Graphics2D extends the Graphics class has the following method to draw a shape: public void draw(Shape). java.awt.geom.Line2D.Double implements the Shape interface and represents a line segment specified with double coordinates. Its constructor, Line2D.Double(double X1, double Y1, double X2, double Y2), constructs and initializes a Line2D from the specified coordinates. Graphics uses a coordinate system that measures points from the top left corner. You are to use these classes (Graphics2D and Line2D.Double) to draw the image for this project. Refer to the examples of using a recursive method to create a drawing of a ruler and a fractal star (pages 308 311) in the textbook to create your own, original drawing using recursion. Another example, is the recursively drawn Koch star shown below the terminating condition determines the final shape of the star.

Write a Java program to draw a design using recursion. Follow all commenting conventions mentioned in class. Your program must have a comment block at the top of the main method describing the program purpose, input, and output. Name your class containing the main method DrawIt.java and your class that does the drawing RecursiveShape.java. DrawIt.java is where you create a frame and then you add an instance(s) of RecursiveShape.java to the frame. Each student will give a short presentation of his recursive program. In this presentation, you will walk through the code explaining your design decisions/challenges/etc. and demonstrate the final drawing.

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!