Results 1 to 4 of 4
- 01-22-2010, 04:27 AM #1
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
build a house with windows and a door
***where am I going wrong; posting the directions after this thread***
****I'm very new to this******
import Guzdial.*;
import java.awt.*;
import java.applet.*;
/**
* Course: 2301
* Section: 2
* Professor: Shaw
* Name: Gerald Hart
* Assignment #: homework 1
*/
public class house
{
//It builds a house
static void house(int rectangle);
{
star(50);
turtle.penUp();
turtle.forward(100);
turtle.turn(72);
turtle.penDown();
}
static void rectangle(int width, int height); //Draws a rectangle of 200 x 100);
{
turtle.forward(height);
turtle.turnRight();
turtle.forward(width);
turtle.turnRight();
turtle.forward(height);
turtle.turnRight();
turtle.forward(width);
turtle.turnRight();
}
static void equiliateral(int length);
{
turtle.forward(100);
turtle.turn(120);
turtle.forward (100);
turtle.turn(120);
turtle.forward(100);
}
}
- 01-22-2010, 04:30 AM #2
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
here's the directions
Create a Java class file (source file) using BlueJ named House.java. The 3 methods are:
1. house()
2. rectangle()
3. 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. 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.
-
Where do any methods or constructors of your House class call either the rectangle method or the equilateral method?
-
My recommendations are that
1) you only add a small amount of code to your program at a time, compile frequently, and fix any compilation errors that occur before you add new code.
2) that you try to incorporate the two methods, equilateral and rectangle, into your House class code, and then post any errors or problems you're having after trying this. Also be sure to use code tags and to give us the lines that are causing the errors.
Much luck!
Similar Threads
-
ant build
By sardare in forum New To JavaReplies: 4Last Post: 04-02-2009, 10:02 PM -
Hello gurus' in the house
By javahsm in forum New To JavaReplies: 0Last Post: 11-29-2008, 06:11 PM -
clean and Build
By bhanu in forum EclipseReplies: 3Last Post: 07-03-2008, 01:13 PM -
To those who want to build a new OS, you may read this for a while...
By sukatoa in forum Forum LobbyReplies: 0Last Post: 06-11-2008, 01:56 PM -
building a house
By dc2acgsr99 in forum Java AppletsReplies: 4Last Post: 03-07-2008, 11:18 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks