Write a method called triangleArea that accepts the three side lengths of a triangle as parameters and

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

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: