Question
For this C++ program, you will create an enumeration called Triangle, which will have the values SCALENE, ISOSCELES, EQUILATERAL, and INVALID. An equilateral triangle is
For this C++ program, you will create an enumeration called Triangle, which will have the values SCALENE, ISOSCELES, EQUILATERAL, and INVALID. An equilateral triangle is a triangle whose sides are all the same length. An isosceles triangle has two sides that are the same length. A scalene triangle has sides that are all of different lengths. You will write 3 functions dealing this this data type:
You will write a function called getTriangleType that takes 3 unsigned integers as parameters, which each represent the length of a side of a triangle. The function will return a Triangle value (either SCALENE, ISOSCELES, EQUILATERAL, or INVALID). Note: In a triangle, the sum of the lengths of any two sides must be greater than the length of the third side.
You will write a void function called printTriangle that takes a Triangle value as a parameter. The function will print a string that corresponds to the type of triangle (e.g., "scalene" will be printed for the value SCALENE).
You will also write a main function. The main function will prompt the user to enter 3 unsigned integers representing the lengths of the sides of a triangle. It will then call the getTriangleType function to determine the type of triangle. Then it will call the printTriangle function to print the type of triangle.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started