Question: In main( ) function, the user is asked to input three edges of a triangle: edge1, edge2, and edge3. If the input edges do not
In main( ) function, the user is asked to input three edges of a triangle: edge1, edge2, and edge3. If the input edges do not form a valid triangle, output an error message (the sum of any two edges is greater than the third edge) If it is a valid triangle, calculate and output its area and perimeter. Formulae: perimeter=edge1+edge2+edge3 area=?(s*(s-edge1)*(s-edge2)*(s-edge3)) where s=perimeter/2 You need to create the following functions in a header file named TriangleLib.h and call them. When calculating area, you may also need to call perimeter function. bool isValid(double edge1, double edge2, double edge3) double perimeter(double edge1, double edge2, double edge3) double area(double edge1, double edge2, double edge3)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
