Hello, I am a new programmer and am faced with a problem which I am not
totally sure how to start. The problem is as follows:
====================================================
Using recursion, compute the area of a polygone. Cut off a triangle
and use the fact that a triangle with corners (x1,y1), (x2,y2), (x3,
y3) has
area = |(x1)(y2) + (x2)(y2) + (x3)(y1) - (y1)(x2) - (y2x3) - (y3x1)|/2
The program will be testerd by redirecting a text file to its standard
input. Such a file represent a polygone. Within a file, each line
contains two (non-scientific notation) floating point number to
indicate the corrdinates of a vertex.
====================================================
My major problem is the recursive thought that it involves, I can
visualize doing this non-recursively quite easily, so if anyone could
offer any advice on how a recursive approach to this would be started I
would be very greatful.
Thanks.
Roedy Green - 19 Mar 2006 21:26 GMT
>Hello, I am a new programmer and am faced with a problem which I am not
>totally sure how to start.
see http://mindprod.com/jgloss/recursion.html
It will show you some examples of recursive code.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Thomas Weidenfeller - 20 Mar 2006 09:39 GMT
>> Hello, I am a new programmer and am faced with a problem which I am not
>> totally sure how to start.
>
> see http://mindprod.com/jgloss/recursion.html
>
> It will show you some examples of recursive code.
You forgot to point to
http://mindprod.com/jgloss/homework.html
The OP didn't even hide the original homework question. New programmer?
Well, what a creative definition for a student.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
Oliver Wong - 20 Mar 2006 21:54 GMT
> Hello, I am a new programmer and am faced with a problem which I am not
> totally sure how to start. The problem is as follows:
[quoted text clipped - 16 lines]
> offer any advice on how a recursive approach to this would be started I
> would be very greatful.
How would you solve this non-recursively?
- Oliver