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
What does CPU stand for
nata0808 [166]

Answer:

Central Processing Unit

Explanation:

Principle part of any digital computer system

6 0
2 years ago
Write a program that will take an integer and add up each of the number’s digits, count the number of digits in the number, and
Inga [223]
For count digits, you could just convert it to a String and check the length
Sum digits, convert to string then seperate each character with charAt then convert it to numbers in the return statement.
Average digits you can convert it to a String and then convert them back after taking them apart.
5 0
3 years ago
Read 2 more answers
What are the four different orchestral instrument families?
natka813 [3]

Answer:

Gutair

Violen

cello

Double Brass

Harp

Explanation:

7 0
3 years ago
Read 2 more answers
You are creating a story map about Mexico. After configuring the web app template, you launch the app to test it. When the app o
navik [9.2K]
Nbdjsksjsidjdjwkwejd
3 0
3 years ago
Alicia uses a software application to store the names, email addresses, and phone numbers of her friends in alphabetical order. 
SpyIntel [72]

I think she's using Excel.

6 0
3 years ago
Other questions:
  • Hacker is a person who illegally breaks into a system or network without any authorization to destroy, steal sensitive data or t
    14·1 answer
  • What is an optical storage device?
    7·2 answers
  • Write a program that prints the day number of the year, given the date in the form month-day-year. For example, if the input is
    9·1 answer
  • What is hydraulic fracturing?
    7·1 answer
  • 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
    12·2 answers
  • Heidi uses her computer to write articles for a newspaper. She uses a program to listen to the articles before she submits them
    5·1 answer
  • When you send an email to your professor, a server holds that email until the professor requests it.
    8·1 answer
  • The blank provides access to the internet May also be internal ??
    14·1 answer
  • JAVA
    5·1 answer
  • The action of entering data into your computer. This can be text typed in a word processing document, keywords entered in a sear
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!