CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Help Please!!!!

  1. #1
    Join Date
    Nov 2010

    Help Please!!!!

    Ok guys I am having serious trouble finishing off the following program for an assignment Please help me out!

    The aim is to simulate growing of trees in a forest, seen from above. The forest is an
    initially empty square area.
    There are four kinds of trees: beeches, birches, spruce, and a single magic tree. They
    di er in the way they look and grow. Trees have a circular treetops, and the di erent
    kinds have di erent colors. You may choose the colors; violet birches are ok. The
    diameter of each tree increases by a constant each year; that is the diameter in year k is
    the diameter in year k1 plus a number c. Beeches grow fastest, their diameter increases
    by more than that of the other trees. Spruce grow slowest. The magic tree behaves
    somewhat di erently. It grows most of the time but sometimes shrinks. Sometimes it
    also changes its location. To find suitable values for the parameters is up to you.
    The trees are initially at random positions, the magic tree is in the center of the forest.
    On Campusnet you and four Java files. File ForestSimulation.java defines a class
    which runs the simulation including all the graphic. File ConstAndUtil.java de nes
    some constants determining the forest size etc. It also contains some \utility" methods
    that you might find helpful. File ForestDriver.java contains the main method where
    a simulation is created and started. Finally there again is StdDraw.java which
    is used to display the simulation.
    What you have to do:
    a) Look at the files ForestSimulation.java, ConstAndUtil.java, and ForestDriver.java
    and understand what the programs do and how they interact.
    b) De ne the missing classes to make the simulation run. Ensure that the program-
    mer is forced to de ne all methods necessary to run the simulation. This can be
    done in two ways, both are appropriate.
    c) Ensure that the trees behave as described.
    The file ForestSimulation.java must not be changed, the other two files
    Figure 1 shows an example and under the following link you can find a video showing
    how such a simulation might run.
    I have attached the parts necessary to finish this program . I am quite new at java programmering.

    Attached Files Attached Files

  2. #2
    Join Date
    May 2006

    Re: Help Please!!!!

    Ok so this is your homework question what exactly are you stuck on.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.