Hi basically im building a program for universtity and i am still very
rusty when it comes to programming using java, ive been ok up to now
but this exercise i need assistance. I have basically got to work out
the length of the longest side of a triangle when given the other two
shorter sides measurements. Then the program must also workout the
area of the triangle. Can anyone help?
The results from once i ahve compiled and ran the program in command
prompt is suposed to look like this....
***TRIANGLE***
Side A = 3.00 cms
Side B = 4.00 cms
Side C = 5.00 cms
Area = 6.00 sq cms
Please any assistance would be brilliant thanks.
Gordon Beaton - 01 Mar 2007 13:24 GMT
> The results from once i ahve compiled and ran the program in command
> prompt is suposed to look like this....
[quoted text clipped - 7 lines]
>
> Please any assistance would be brilliant thanks.
Your program appears to work just fine. Apparently you have no
problems implementing the Pythagorean theorem.
/gordon

Signature
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
Patricia Shanahan - 01 Mar 2007 15:16 GMT
> Hi basically im building a program for universtity and i am still very
> rusty when it comes to programming using java, ive been ok up to now
[quoted text clipped - 14 lines]
>
> Please any assistance would be brilliant thanks.
You need three facts, such as two lengths and the angle between those
sides, to define a triangle.
The example is a right angled triangle, and the problem is much simpler
(Pythagoras' theorem vs. general trigonometry) if you are allowed to
assume right angled.
For general advice on getting started see
http://home.earthlink.net/~patricia_shanahan/beginner.html
For more specific advice, you will need to give more information about
what you have done so far and where you are stuck. For example, can you
read in the two shorter lengths and produce the first two lines of output.
Patricia
murari garg - 04 Mar 2007 08:38 GMT
On Mar 1, 5:57 pm, danny.p...@hotmail.com wrote:
> Hi basically im building a program for universtity and i am still very
> rusty when it comes to programming using java, ive been ok up to now
[quoted text clipped - 14 lines]
>
> Please any assistance would be brilliant thanks.
i think you have not specify your problem correctly.
two condition arise.
1. if you triangle is right angle trianle then it very simple
programme.
you can use pythgorus theorem to know length of third side.
and for area you can use this formul
(1/2)*a*b
where a , b are side having angle in between 90.
2. if triangle is not right angle trieanglr then one more parameter
must be given that is the angle b/w the side.
so you check it out if you find that you have forgotten to write
something and it should be corrected then mail me . i will going to
write java prg for it and mail to you.