Results 1 to 9 of 9
  1. #1
    mk3823 is offline Member
    Join Date
    Oct 2008
    Posts
    7
    Rep Power
    0

    Default Need help starting program

    I'm not really sure how to start this program. Here's the description.



    Program 215c
    (donít fence me in)

    Program Description: You want to build a fence for your livestock and use your neighbors fence for one side. You only have 100 yards of fencing material. You want to build the fence to produce the largest rectangular area possible. Write a program that will determine the largest area you could attain with the 100 yards of fencing material while using your neighbor's fence for the fourth side.


    Be sure you use enough different Xís to determine the largest area.

    Statements Required: output, loop control, decision making

    Sample Output:

    With 100 yards of fencing material:
    A rectangle 25 X 50 yards produces the maximum area of 1250 square yards.

  2. #2
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

    Default

    Lesson: A Closer Look at the "Hello World!" Application (The Javaô Tutorials > Getting Started)

    This is a Hello World tutorial that teaches you the basics of how to create a Java application.

  3. #3
    mk3823 is offline Member
    Join Date
    Oct 2008
    Posts
    7
    Rep Power
    0

    Default

    I already know that. I just need a hint on how to approach this program with the given conditions.

  4. #4
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    7

    Default

    I think the first step would be to develop a mathematic algorithm to determine the largest area and then transfer that into Java.

    Hint* you have to know the length of your neighbors fence. That is 2 sides of your rectangle. The remaining fence is whats leftover for the other 2 sides.

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by mk3823 View Post
    I'm not really sure how to start this program. Here's the description.



    Program 215c
    (donít fence me in)

    Program Description: You want to build a fence for your livestock and use your neighbors fence for one side. You only have 100 yards of fencing material. You want to build the fence to produce the largest rectangular area possible. Write a program that will determine the largest area you could attain with the 100 yards of fencing material while using your neighbor's fence for the fourth side.


    Be sure you use enough different Xís to determine the largest area.

    Statements Required: output, loop control, decision making

    Sample Output:

    With 100 yards of fencing material:
    A rectangle 25 X 50 yards produces the maximum area of 1250 square yards.
    First of all, take peace of paper and write a mathematical model for this. Just think on the way of maths only. Once you have a strong model, you can start work on with Java. That's the best way lol.

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,883
    Rep Power
    25

    Default

    The math would be:
    area = width X length (of enclosure)
    100 = 2 * length + width (or 2 * width + length)

    Change length and width values until you find max area.

  7. #7
    mk3823 is offline Member
    Join Date
    Oct 2008
    Posts
    7
    Rep Power
    0

    Default

    Hey, thanks for the help! I finally got the answer. I just needed to take another look at the directions.

  8. #8
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,883
    Rep Power
    25

    Default

    When in doubt, read the directions.

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by mk3823 View Post
    Hey, thanks for the help! I finally got the answer. I just needed to take another look at the directions.
    Did you solve the problem? Most of the time any application development can be divide in to three parts,

    1. Analysis
    Decide what type of applications it is, what's the expecting results and so on.

    2. Design
    Develop a model. How to handle user inputs and so on. Write all the process in a piece of paper. Pseudo code is the best solution. UML is too.

    3. Development
    Coding.

Similar Threads

  1. Error starting the plugin
    By gudduamar in forum Eclipse
    Replies: 0
    Last Post: 05-12-2008, 02:45 PM
  2. Application starting initially
    By rameshraj in forum Advanced Java
    Replies: 14
    Last Post: 04-27-2008, 08:48 PM
  3. Indexing starting with 1
    By ravian in forum New To Java
    Replies: 4
    Last Post: 01-04-2008, 01:03 PM
  4. Help, starting with java
    By mathias in forum New To Java
    Replies: 2
    Last Post: 08-15-2007, 08:15 AM
  5. just starting
    By specbailey in forum New To Java
    Replies: 23
    Last Post: 08-14-2007, 12:25 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
  •