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
E-mail has made it very easy to send a message to more than one person at any time of day from just about anywhere. If you wante
lana66690 [7]
You should send a Carbon Copy to your manger. You would type your manager's email into the slot next to cc.
5 0
3 years ago
What is the QOS model?
Andre45 [30]

Answer:

Quality Of Service

Explanation:

Technology that manages data traffic to reduce packet loss, latency and jitter on the network. QoS controls and manages network resources by setting priorities for specific types of data on the network.

5 0
3 years ago
First, define an integer variable and assign it any value of your choice. Then you'll need to perform the following operations w
Tcecarenko [31]
Python code:

x=121
x += 9
x *= 2
x -= 4
x >>= 2
x -= 121
7 0
3 years ago
What best describes the purpose of occupational safety and health Administration
IRISSAK [1]

Under the Occupational Safety and Health Act of 1970, employers are responsible for providing safe and healthful workplaces for their employees. OSHA's role is to help ensure these conditions for America's working men and women by setting and enforcing standards, and providing training, education and assistance.

5 0
3 years ago
Read 2 more answers
An example of software is a
Veseljchak [2.6K]

Answer: false

Explanation:

5 0
3 years ago
Other questions:
  • What effects will the different types of lighting produce on mountains?
    15·1 answer
  • Please Do Solve it guys...
    6·1 answer
  • What is the output?<br> &gt;&gt;&gt; phrase = "hello mom"<br> &gt;&gt;&gt; phrase upper()
    6·2 answers
  • Jason is working on a Microsoft Excel worksheet and he wants to create a Print Preview shortcut. His teacher asks him to access
    9·1 answer
  • Whats the answer :)?<br>i will give brainslist​
    11·1 answer
  • Reading (BCK FORM 2C IT 2020-2021)
    12·2 answers
  • You have a passage of text that needs to be typed out, but some of the letter keys on your keyboard are broken! You're given an
    14·1 answer
  • 5 efectos del desarrollo tecnológico en el medio ambiente
    14·1 answer
  • After a group sets a project schedule, members should be prepared to
    7·1 answer
  • Susan discovers the following log entries that occurred within seconds of each other in her Squert (a Sguil web interface) conso
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!