In C++ Design a modular program to input three numbers, each representing the le
ID: 3853874 • Letter: I
Question
In C++
Design a modular program to input three numbers, each representing the length of a side of a triangle. Your program then displays whether the sides could form a scalene, isosceles, equilateral triangle, or no triangle. Your program must define and use an enumeration type, triangleType, that has the values scalene, isosceles, equilateral, and noTriangle .
needed
structure chart as a screen shot or picture
source code for with
The name of your program as a comment at the top of the file
IPO chart incorporated as comments after the name of the file
IPO charts for your functions as comments before the prototypes of your functions
A screen shot or picture of the results after running your program with your test data
Explanation / Answer
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
using namespace std;
enum triagnle {
scalene=0,
isosceles,
equilateral,
notriangle
};
int main() {
int s1,s2,s3;
scanf("%d %d %d",&s1,&s2,&s3);
if(s1 == 0 or s2 == 0 or s3 == 0) {
cout<<notriangle<<endl;
return 0;
}
if(s1 != s2 and s1 != s3 and s2 != s3) {
cout<<scalene<<endl;
return 0;
}
if(s1 == s2 and s1 == s3 and s2 == s3) {
cout<<equilateral<<endl;
return 0;
}
if(s1 == s2 or s1 == s3 or s2 == s3) {
cout<<isosceles<<endl;
return 0;
}
}