Results 1 to 10 of 10
- 01-24-2010, 11:57 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
building a house but having problems connecting it
import Guzdial.*;
/**
* Course: ....
* Section: .....
* Professor: ......
* Name: .....
* Assignment #: ......
*/
public class House
{
static World earth;
static Turtle turtle;
static void house()
//It builds a house
{
earth = new World();
turtle = new Turtle(earth);
rectangle(100,100); //Draws a rectangle of 200 x 100
equilateral (100); //Draws equilateral triangle of 100 on each side
}
//Draws four sides of a rectangle of a given width and height
static void rectangle(int width, int height)
{
turtle.forward(height);
turtle.turnRight();
turtle.forward(width);
turtle.turnRight();
turtle.forward(height);
turtle.turnRight();
turtle.forward(width);
turtle.turnRight();
}
//Draws three sides of a equilateral triangle of a given length
static void equilateral(int length)
{
turtle.forward(100);
turtle.penUp();
turtle.forward(100);
turtle.turn(72);
turtle.penDown();
turtle.penUp();
turtle.forward(100);
turtle.turn(72);
turtle.penDown();
turtle.penUp();
turtle.forward(100);
turtle.turn(72);
turtle.penDown();
turtle.penUp();
turtle.forward(100);
turtle.turn(54);
turtle.penDown();
turtle.turn(120);
turtle.forward (100);
turtle.turn(120);
turtle.forward(100);
}
}
- 01-25-2010, 12:47 AM #2
Member
- Join Date
- Nov 2009
- Posts
- 96
- Rep Power
- 0
I think that everybody is wondering: what is your question?
- 01-25-2010, 01:18 AM #3
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
My house is sitting to the left of my roof. Also where should I start with the 2 two windows and door
- 01-25-2010, 03:44 AM #4
Member
- Join Date
- Nov 2009
- Posts
- 96
- Rep Power
- 0
Post the code of the classes Turtle and World, please (using also the code tag). In other words, post some code that can be compiled an run.
-
- 01-25-2010, 04:27 AM #6
My guess is that you're not understanding the coordinate system in java or the turtle software. By default, java draws from top to bottom as the Y coord increases, and left to right as X increases, but your drawing package might be different. Perhaps you are not starting the drawing of your shapes where you think you are?
- 01-25-2010, 02:40 PM #7
Member
- Join Date
- Nov 2009
- Posts
- 96
- Rep Power
- 0
- 01-26-2010, 12:15 AM #8
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
I dont know what jar files are but here are the directions: Please help because it due by midnight...I've been working on this for 4 days now
Create a Java class file (source file) using BlueJ named House.java. In this class you will have the following three methods:
house()
rectangle()
equilateral()
The rectangle() and equilateral() method will work as they did for the versions you did in the Lab. The house() method will draw a house, and it must call the rectangle() and equilateral() methods while it is doing so. The house drawn must have a triangular roof, a rectangular base, and a door and two windows. Your house() method will serve the same function as your draw() method served in the last Lab, although in your house() method you will need to determine precisely where you want the turtle to go before it draws the equilateral triangle that will serve as the roof of the house, and before it draws the rectangles which will serve as the base of the house, the door and the two windows. Be sure your program compiles and runs without error.
Be sure your program compiles and runs without error.
Assignment Due: January 25, 2010 by 11:59 P
- 01-26-2010, 08:06 AM #9
oh haha! Yeah, this is one of the famous bluej tutorials. Bluej comes with a pre-made house when you download the tutorial files. Perhaps you could look at those and see what you're doing wrong? I'm convinced you're drawing your rectangles backwards or something simple like that. You could always post a link to your bluej project for us to see.
- 01-26-2010, 06:00 PM #10
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
Problems with connecting two sockets on the same application.
By jrsofty in forum NetworkingReplies: 0Last Post: 12-01-2009, 01:04 PM -
problems with connecting to Oracle DB in NetBeans
By m16k2002 in forum Web FrameworksReplies: 6Last Post: 03-25-2009, 10:14 AM -
hello the community & mysql connecting problems
By scchia in forum New To JavaReplies: 6Last Post: 07-16-2008, 08:49 AM -
building a house
By dc2acgsr99 in forum Java AppletsReplies: 4Last Post: 03-07-2008, 11:18 PM -
problems with connecting to Oracle DB in NetBeans
By m16k2002 in forum NetBeansReplies: 0Last Post: 08-07-2007, 07:01 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks