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
The _____ option will require users to have a password to access the document.
Zepler [3.9K]
The login option will require users to have to have a password to access the document
6 0
3 years ago
Read 2 more answers
Which wireless technology connects with most mobile devices?
LenaWriter [7]

Answer:

¡) Internet

¡¡) Alexa

¡¡¡) Electronic Devices

8 0
2 years ago
Microsoft word's spelling checker will offer suggestions on misspelled words.<br> True)<br> False)
Rasek [7]
This is true. I hope I was helpful!
7 0
3 years ago
Read 2 more answers
NEED DONE ASAP Which option in the Insert Table dialog box should you check if you want smaller tables to fit on a single page?
Damm [24]
The correct answer is Border
3 0
3 years ago
Read 2 more answers
Proponents of Internet freedom see its _____________ as providing protection for unpopular expression; proponents of greater Int
diamong [38]

Answer:

anonymity

Explanation:

<h2><u>Fill in  the blanks </u></h2>

Proponents of Internet freedom see its <u>anonymity </u>as providing protection for unpopular expression; proponents of greater Internet control see it as the Internet's greatest danger.

6 0
3 years ago
Other questions:
  • "what is the #1 resource used when researching a product online?"
    5·1 answer
  • If you need to multiply 400, 2, and 1 ½, what would you type on the numeric keypad?
    9·2 answers
  • You can access various sites on the WWW by using hyperlinks or by
    14·1 answer
  • Which of the following parameters should match in order for a pair of routers to form an adjacency when running OSPFv2? (Points
    9·1 answer
  • What type of form control is typically used for displaying text or numbers?
    8·2 answers
  • Which statement accurately describes DTP programs?
    11·1 answer
  • Indicate the time efficiency classes of the three main operations (i.e., FindMax, DeleteMax, and Insert) of the priority queue i
    11·1 answer
  • If you were infiltrating a network (10.16.0.0/16), and searching for vulnerabilities (while trying to remain undetected), why wo
    11·2 answers
  • You began a small mobile app company. To help market your apps, you create a social media site. The site allows users to join co
    15·1 answer
  • A small network that consists of devices connected by Bluetooth, such as a smartphone and a computer, is referred to as a ______
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!