1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tatiana [17]
3 years ago
12

Define an enumeration type triangleType that has the values scalene, isosceles, equilateral, and noTriangle. Write a function tr

iangleShape 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.) Write a program that prompts the user to input the length of the sides of a triangle and outputs the shape of the triangle.
Computers and Technology
1 answer:
Brums [2.3K]3 years ago
6 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   int side1=0;

   int side2=0;;

   int side3=0;

cout <<"Enter side one measurement";

cin >> side1;

cout <<"Enter side two measurement";

cin >> side2;

cout <<"Enter side three measurement";

cin >> side3;

if(side1+side2>side3||side1+side3>side2||side2+side3>side1){

if (side1==side2 && side2==side3)

{

   cout <<"equilateral triangle"<<endl;

}

else if(side1==side2||side2==side3||side1==side3){

   cout <<"Isosceles triangle"<<endl;

}

else{

      cout <<"scalene triangle"<<endl;

}

}else{

   cout<<"No triangle";

}

   return 0;

}

Explanation:

The code is written in c++. It takes measurements of each side from users as input and check the types of triangle based on the following formula.

1. Equilateral Triangle

If all sides of a triangle are equal than it's an equilateral triangle.

2. Isosceles Triangle

If any two  sides of a triangle are equal than it's an Isosceles triangle.

3. Scalene Triangle

If all the sides of a triangle are of different length than it's an Scalene triangle.

In a triangle the sum of two sides is greater than third side otherwise it's not a triangle.

You might be interested in
How would a designer interpret the word denier?
xxMikexx [17]

Answer:Denier is a unit of measurement that is used to determine the fiber thickness of individual threads or filaments used in the creation of textiles and fabrics. Fabrics with a high denier count tend to be thick, sturdy, and durable. Fabrics with a low denier count tend to be sheer, soft, and silky.

Explanation:

idk if this is right.

7 0
3 years ago
Read 2 more answers
What tabs found in the Windows Task Manager dialog box
fredd [130]
The applications you have open, and some background processes.
7 0
3 years ago
What animal is perry the platypus ​
valkas [14]

Answer: Agent P or simply Perry

Explanation:

4 0
3 years ago
Read 2 more answers
How to adjust screen from 1024x728 to 800x600
densk [106]
Goto settings>display>resolution what os is your system? this was for a win 10
5 0
3 years ago
Acess labeling windows​
Debora [2.8K]

Answer:

I got the same thing

Explanation:

8 0
3 years ago
Other questions:
  • Tom's using Google Ads to promote his bicycle store. He's created an Android App and needs to measure how effectively the curren
    14·1 answer
  • What type of organizational structure would you want to use for this company (by function, by process, by product, and so on)? E
    11·1 answer
  • Assume you have a project with seven activities labeled A-G (following). Derive the earliest completion time (or early finish-EF
    15·1 answer
  • What are the best data structures to create the following items? And why?
    13·1 answer
  • 9. "मेरे तो गिरधर गोपाल, दूसरो ना कोई
    5·1 answer
  • You are looking at computer ads. One has a processor that is 3.64GHz. What does this mean?
    5·1 answer
  • Which of the following is not a responsibility of an operating system?
    9·2 answers
  • What can a user modify on a business card using the Edit Business Card dialog box? Check all that apply.
    6·1 answer
  • What will be the output, if any, when the user clicks the right mouse button?
    5·1 answer
  • Active directory and 389 directory server are both compatible with which directory access protocol?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!