Results 1 to 4 of 4
  1. #1
    youngflames is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Default 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);
    }



    }

  2. #2
    youngflames is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Default 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.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Where do any methods or constructors of your House class call either the rectangle method or the equilateral method?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    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

  1. ant build
    By sardare in forum New To Java
    Replies: 4
    Last Post: 04-02-2009, 11:02 PM
  2. Hello gurus' in the house
    By javahsm in forum New To Java
    Replies: 0
    Last Post: 11-29-2008, 07:11 PM
  3. clean and Build
    By bhanu in forum Eclipse
    Replies: 3
    Last Post: 07-03-2008, 02:13 PM
  4. Replies: 0
    Last Post: 06-11-2008, 02:56 PM
  5. building a house
    By dc2acgsr99 in forum Java Applets
    Replies: 4
    Last Post: 03-08-2008, 12:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •