Question: Complete the method, areaOfTriangle(). The method will take in the side lengths, a, b, and c, of a triangle as double values. The method should
Complete the method, areaOfTriangle(). The method will take in the side lengths, a, b, and c, of a triangle as double values. The method should return the area of the triangle as a double value. Calculate the area using Heron's formula, where S is the semi-perimeter of the triangle:
You may assume the values of a, b, and c are valid, side-lengths of a triangle.
Starter Code:
public class Triangle { public static double areaOfTriangle(double a, double b, double c) { //TODO: complete this method } }
Heron's Formula S= A+B+C 2 Area yS(S - A)(S - B) (S - C)Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
