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:
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Question Posted: