Results 1 to 9 of 9
Thread: Need help starting program
 10312008, 06:55 PM #1Member
 Join Date
 Oct 2008
 Posts
 7
 Rep Power
 0
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.
 10312008, 07:20 PM #2Senior Member
 Join Date
 Sep 2008
 Posts
 564
 Rep Power
 13
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.
 10312008, 08:10 PM #3Member
 Join Date
 Oct 2008
 Posts
 7
 Rep Power
 0
I already know that. I just need a hint on how to approach this program with the given conditions.
 10312008, 09:27 PM #4
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.
 11012008, 06:10 AM #5
 Join Date
 Jul 2007
 Location
 Colombo, Sri Lanka
 Posts
 11,370
 Blog Entries
 1
 Rep Power
 26
 11012008, 02:27 PM #6
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.
 11012008, 06:30 PM #7Member
 Join Date
 Oct 2008
 Posts
 7
 Rep Power
 0
Hey, thanks for the help! I finally got the answer. I just needed to take another look at the directions.
 11012008, 06:51 PM #8
When in doubt, read the directions.
 11022008, 02:41 AM #9
 Join Date
 Jul 2007
 Location
 Colombo, Sri Lanka
 Posts
 11,370
 Blog Entries
 1
 Rep Power
 26
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

Error starting the plugin
By gudduamar in forum EclipseReplies: 0Last Post: 05122008, 02:45 PM 
Application starting initially
By rameshraj in forum Advanced JavaReplies: 14Last Post: 04272008, 08:48 PM 
Indexing starting with 1
By ravian in forum New To JavaReplies: 4Last Post: 01042008, 01:03 PM 
Help, starting with java
By mathias in forum New To JavaReplies: 2Last Post: 08152007, 08:15 AM 
just starting
By specbailey in forum New To JavaReplies: 23Last Post: 08142007, 12:25 AM
Bookmarks