Question: Taskl Write a program that prompts the user to input the length of the sides of a triangle and outputs the shape of the triangle
Taskl Write a program that prompts the user to input the length of the sides of a triangle and outputs the shape of the triangle (scalene, isosceles, or equilateral) based on the lengths of the sides of the triangle. Define an enumeration type triangleType that has the values scalene, isosceles, equilateral, and noTriangle. Write a function triangleShape that takes as parameters three numbers, each of which represents the length of a side of the triangle. The function should return the shape of the triangle. (Note: In a triangle, the sum of the lengths of any two sides is greater than the length of the third side.) nter the Tengths of the three sides of a triangle. 345 The shape of the triangle is: scalene Process returned 0 (OxO) execution time 10.392 s Press any key to continue. s 5 5 The shape of the triangle is: equilateral rocess returned o (ox0) execution time 4.341 s Press any key to continue. nter the Tengths of the three sides of a triangte 6 3 The shape of the triangle is: isosceles Process returned O (0x0) execution time 4.156 Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
