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
Bob's Assembly is a hardware manufacturer. It specializes in builders' hardware for doors, cabinets, windows, and bathrooms. Bob
Snezhnost [94]

Answer:

distinctive competence

Explanation:

The distinctive competence denotes the various characteristic of certain business on which behalf that business perform better than its competitors. And since the business succeeds in doing those things better than its competitors, that business gains a competitive advantage over its competitors. And here, Bob's assembly is a hardware manufacturer for the doors, cabinets, windows and the bathrooms. And his assembly products are more durable and economical than its competitor's products. And thus Bob has a competitive advantage over its competitors.

3 0
3 years ago
Question 5 of 25
Arisa [49]

Answer: d

Explanation; Hopes this helps!!

3 0
2 years ago
Read 2 more answers
Which LIKE operator would match a single character?<br><br> *<br> ?<br> []<br> #
algol [13]

Answer:

underscore hope that helps

Explanation:

4 0
2 years ago
This exspansion slot essentially replaced PCI and AGP slots
MrRa [10]
PCI and AGP slots have been replaced with PCI-E slot (PCI-Express). There are different types of PCI-E buses:

PCI Express 1x (250 [500] * MB/s)
PCI Express 2x (500 [1000] * MB/s)
PCI Express 4x (1000 [2000] * MB/s)
PCI Express 8x (2000 [4000] * MB/s)
PCI Express 16x (4000 [8000] * MB/s)
<span>PCI Express 32x (8000 [16000] * MB/s)

I hope that's what you meant :)</span>
4 0
3 years ago
Which of the following is an example of a runtime error?
Rina8888 [55]

Answer:

missing quotation marks around a string literal

6 0
2 years ago
Other questions:
  • The _____ icon looks like a clipboard with a page of paper attached. Cut Copy Paste Clipboard
    5·1 answer
  • A _____ is a device that not only provides surge protection, but also furnishes desktop computers and network devices with batte
    7·1 answer
  • Select all that apply.
    8·2 answers
  • Which of the following function headings arevalid? If they are invalid, explain why.
    12·1 answer
  • Whats the answer to this question?
    7·1 answer
  • Data flow is not a major consideration when building an analytics model. T/F
    13·1 answer
  • Choose the parts of the browser window. PLEASE ANSWER QUICKLY TEST
    12·2 answers
  • Write a method named printGPA that takes in as a parameter a Scanner to read in user input, and calculates a student's grade poi
    8·1 answer
  • Explica el empleo de cuentas y contraseñas en archivos
    6·1 answer
  • What is the difference between a field and an infoobject? What is the advantage of using infoobjects instead of fields in an ads
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!