Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am working in the Introduction to Computing & Programming with JAVA A Multimed

ID: 3857574 • Letter: I

Question

I am working in the Introduction to Computing & Programming with JAVA A Multimedia Approach book by Mark Guzdial and Barbara Ericson. We are asked to modify the Turtle class so that it has a "draw()" method and a "draw(Color color)" method. The implementation of these draw methods should draw a shape of your choosing. Create three subclasses of Turtle: SpiralTurtle, ConfusedTurtle, and SmartTurtle. Override the "draw()" methods of the subclasses. The SpiralTurtle "draw()" method should draw a spiral. The ConfusedTurtle "draw()" should draw an erratic pattern of random sized segments drawn in chaotic directions. The Deitel & Deitel textbook has a section entitled "Case Study: Random-Number Generation" which demonstrates how to generate random numeric values within a given range. Your ConfusedTurtle "draw" will need to randomly choose lengths and directions to control its drawing movement. Be sure that the "draw" method has a finite number of steps to its movement. The SmartTurtle "draw()" method should draw a "design" of your own choosing.

Create a BaleOfTurtles class. This class will have a "main" method. This method will perform the following operations:

Create a "World".

Initialize Array of three Turtles with references to a SpiralTurtle, a ConfusedTurtle, and a SmartTurtle. Be sure that these Turtles are placed with the current World.

Create a Color object representing a color of your choosing.

Iterate through your Turtle Array, and call the "draw(Color color)" using each Turtle reference within the Array.

I am having trouble setting up the main class in Bale of Turtles. Can you help me do that with what they are asking. I also need help with the SprialTurtle drawing a spiral. Thanks

Explanation / Answer

Here, they are asking you to create three subclass of Turle which will override the method draw() from turtle. Draw method in each slass will perform some funtion according to the class. Bale of Turles class will have a main method which will instantiate the Three classes in an array. Below is the code for this. Hope it helps you. Please provide the CF score by liking the answer. Thanks in advance.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote