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

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!