Help needed!

D

danny.p-87

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.
 
G

Gordon Beaton

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.

Your program appears to work just fine. Apparently you have no
problems implementing the Pythagorean theorem.

/gordon
 
P

Patricia Shanahan

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.

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
 
M

murari garg

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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top