32.5k views
1 vote
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.

User TMtech
by
7.6k points

1 Answer

5 votes
Example method:
double trianglearea(double a, double b, double c){
double s=a+b+c;
return Math.sqrt(s*(s-a)*(s-b)*(s-c));
}
User Utkarsh Bhatt
by
7.6k points

Related questions

1 answer
3 votes
88.0k views