Question: Write a method called triangleArea that accepts the three side lengths of a triangle as parameters and returns the area of a triangle with those

Write a method called triangleArea that accepts the three side lengths of a triangle as parameters and returns the area of a triangle with those side lengths. For example, the call triangleArea(8, 5.2, 7.1) should return 18.151176098258745 . To compute the area, use Heron’s formula, which states that the area of a triangle whose three sides have lengths a, b, and c is the following. The formula is based on the computed value s, length equal to half the perimeter of the triangle:

area s (s – a) (s – b) (s –c) a +b+ c S = 2

area s (s a) (s b) (s c) a +b+ c S = 2

Step by Step Solution

3.37 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public static double t... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Building Java Programs A Back to Basics Approach Questions!