Can someone please help me "write a drawTree method for the Turtle class"

I am given the following information:

World w = new World();
Turtle t = newTurtle (320, 480, w);

The turtle will begin at the middle of the bottom of the World, facing North.

Use the drawRectangle method to draw the trunk of the tree

public void drawTree()

{

Recommended Answers

Where are you going to draw the tree? Is this a console window or in a GUI?
What class is the drawRectangle() method in?

Jump to Post

Graphical User Interface.

Where will the drawing been seen?

Jump to Post

All 6 Replies

I just need the code for how to draw the tree using drawRectangle method

Where are you going to draw the tree? Is this a console window or in a GUI?
What class is the drawRectangle() method in?

It is a turtle class . The tree should show up in "new World" what is GUI

Graphical User Interface.

Where will the drawing been seen?

The turtle should draw a tree in "new World"

You will have to read the API doc for the classes you are using: Turtle and World. They must be in some third party package.
They are not part of the Java SE packages and classes.
No one can help you with those unknown/undefined classes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.