Question: Programming Language -> C++ Write a program that prompts the user to input the length of the sides of a triangle (as positive integers) and

Programming Language -> C++

Write a program that prompts the user to input the length of the sides of a triangle (as positive integers) and outputs the shape of the triangle.

In the program, 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.

Display the return value of the function triangleShape in a description.

A triangle is scalene if the three sides are unequal (no two sides are the same length). A triangle is isosceles if two of its sides are equal (but not all three for purposes of this lab). A triangle is equilateral if all three sides are the same length. In a triangle, the sum of the lengths of the two sides is greater than the length of the third side. If this formula is not supported, then the three sides do not describe a triangle.

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!