Implements draw so that it draws some interesting picture


This assignment is based on the code that you modified for me last week. Could you please take a look and let me know if you are able to help me?

This is a helping video from my teacher. it is better to watch it first, so you can understand the problem

https://vimeo.com/186215513

(This is the question and the class that you need to work on in the attachment)

(Pictures.java) Using the Turtle class from HW 2 and included in the provided starting code for this homework, implement an abstract class TurtleDrawing. It should have a single protected Turtle field turtle, a constructor TurtleDrawing(Turtle) which initializes this field, and an abstract method public void draw().

Then define two subclasses of TurtleDrawing, where each implements draw() so that it draws some interesting picture. Each of these subclasses should have a constructor with a single Turtle parameter, storing it in its superclass Turtle turtle field, then using this reference field within the draw() to draw the picture. Note that your subclasses should NOT create their own Turtle objects; instead, a Turtle is instantiated outside and passed into the constructors of your TurtleDrawing subclasses.

Finally, define the class Pictures, with an ArrayList field pictures, a method addPicture(TurtleDrawing td), and a method draw(). addPicure(td) should add a new TurtleDrawing td to the pictures list, and draw() should iterate through this list, calling draw() against each of its TurtleDrawing objects.

Pictures.main() should create one Turtle instance, then create an instance of each of your subclasses and pass the same Turtle instance into each. This will allow your two picture to share the same drawing area.

Attachment:- hw.zip

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Implements draw so that it draws some interesting picture
Reference No:- TGS02396898

Now Priced at $15 (50% Discount)

Recommended (96%)

Rated (4.8/5)