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]
4 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]4 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 do I get my text box to stop moving continuously on a Chromebook?
pickupchik [31]

Answer:

Go to Settings. Click on Advanced Settings. Scroll down to the Accessibility section. Make sure that the box next to “Automatically click when the mouse pointer stops” is Unchecked.

Explanation:

here you go hope this helps!!

5 0
3 years ago
Read 2 more answers
What technology did one of the student's have to learn to use in order to help him with his homework in the film, "Disconnected:
4vir4ik [10]

Answer:

The use of typewriter

Explanation:

In the documentary "Disconnected", one of the student in a bid to still be able to handle his assignments had to learn the use of typewriter.

It was difficult in the onset to learn how to use it, but being determined on the task of staying a month without computer, he had to adapt.

He eventually was able to do his assignments just using the typewriter.

The experiment helped shape the participants, at the end of it they learnt to importance of call, text messages and face to face interaction over sending email and social media engagements.

5 0
3 years ago
Read 2 more answers
Which option should you select to accept a tracked change?
Gemiola [76]

Answer:

Accept it.

"Accept a track challenge"

(:

8 0
4 years ago
Read 2 more answers
Database designers typically do not add spaces in field names
Sergio039 [100]
It's true. Spaces in field names not allowed in most database programs.
3 0
3 years ago
Read 2 more answers
¿Hablar de datos o Internet es lo mismo o no? justifique su respuesta​
Tasya [4]

Answer:

no,por qué si hablas de datos puedes tener internet o red en cualquier lugar que vallas o estés , mientras que internet solo puedes usarlo mientras estés en el lugar donde se encuentra el módem.

4 0
3 years ago
Other questions:
  • 1. When you write HTML code, you use ______ to describe the structure of information on a webpage. a. a web address b. tags c. s
    6·1 answer
  • . SQL is a(n) _____ language.
    8·1 answer
  • Discuss and compare shared and switch Ethernet
    12·1 answer
  • Explain in two or three sentences why health science careers are among the fastest growing careers in
    9·1 answer
  • To display a pop-up form for a control, such as account number in a datasheet create a user interface (UI) macro that is associa
    12·1 answer
  • A major concern about ESP claims is that proponents explain both the positive and negative findings. By explaining the negative
    14·1 answer
  • . the fact that a web app is written to be run within any of the standard
    5·1 answer
  • Write a program that prompts the user to enter three cities and displays them in ascending order. Here is a sample run: Enter th
    8·1 answer
  • Which option correctly identifies if the researcher’s approach was the best start in the following scenario and explains why?
    10·2 answers
  • Discuss the core technologies and provide examples of where they exist in society. Discuss how the core technologies are part of
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!