We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,337 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

drawMethod Tree

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()

{
2
Contributors
6
Replies
4 Days
Discussion Span
1 Year Ago
Last Updated
7
Views
GTech4life
Newbie Poster
17 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

GTech4life
Newbie Poster
17 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

NormR1
Posting Sage
Team Colleague
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16

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

GTech4life
Newbie Poster
17 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Graphical User Interface.

Where will the drawing been seen?

NormR1
Posting Sage
Team Colleague
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16

The turtle should draw a tree in "new World"

GTech4life
Newbie Poster
17 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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.

NormR1
Posting Sage
Team Colleague
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0955 seconds using 2.71MB