Home /
Expert Answers /
Computer Science /
please-use-java-computing-the-perimeter-and-the-area-of-a-triangle-given-its-side-lengths-examine-t-pa549
(Solved): Please use JAVA Computing the Perimeter and the Area of a Triangle Given Its Side Lengths: Examine t ...
Please use JAVA
Computing the Perimeter and the Area of a Triangle Given Its Side Lengths: Examine the formulas given on the right side for the illustrated triangle with side lengths a,b and c. - The triangle inequality theorem states that each side of a triangle must be shorter than the other two sides added together. - The perimeter of a triangle can be computed as the sum of its side lengths. - The area of a triangle can be computed by using Heron's formula given its side lengths. Write a program that - reads the lengths of the 3 sides of a triangle (a,b and c) from the user, - checks if the user-entered values form a valid triangle by using the triangle inequality theorem, - prints "Invalid input." if the user-entered values do not form a valid triangle, - and computes then prints the perimeter and the area of the triangle otherwise (i.e., when the user-entered values form a valid triangle). Heron's Formula: area =s(s?a)(s?b)(s?c)? where s=2 perimeter ??