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 Mobile Agricultural Machinery and Equipment Coverage Form does not include coverage for:__________.
satela [25.4K]

Answer:

  • Aircraft, watercraft, their equipment or  parts; automobiles; dealers'  demonstration equipment, machinery and vehicles; dirt bikes, house trailers, mobile homes, mopeds, motorcycles, motorized bicycles or tricycles, snowmobiles, trucks, vehicles primarily designed and licensed for road  use (other than wagons and trailers designed for farming purposes and used principally on the insured location);
  • Barn cleaners, boilers, bulk feed tanks or  bins, bulk milk tanks, pasteurizers or any  permanent fixtures attached to or within a building; c. Cotton pickers, harvester-thresher combines and four-wheel all-terrain vehicles not specifically declared and described in the  Declarations with a Limit of Insurance for  each item;
  • Irrigation equipment; or
  • Contraband, or property in the course of  illegal transportation or trade.

Explanation:

  • Aircraft, watercraft, their equipment or  parts; automobiles; dealers'  demonstration equipment, machinery and vehicles; dirt bikes, house trailers, mobile homes, mopeds, motorcycles, motorized bicycles or tricycles, snowmobiles, trucks, vehicles primarily designed and licensed for road  use (other than wagons and trailers designed for farming purposes and used principally on the insured location);
  • Barn cleaners, boilers, bulk feed tanks or  bins, bulk milk tanks, pasteurizers or any  permanent fixtures attached to or within a building; c. Cotton pickers, harvester-thresher combines and four-wheel all-terrain vehicles not specifically declared and described in the  Declarations with a Limit of Insurance for  each item;
  • Irrigation equipment; or
  • Contraband, or property in the course of  illegal transportation or trade.

3 0
3 years ago
Please help ASAP!
11Alexandr11 [23.1K]

Answer:

role-playing games or just put D

Explanation:

6 0
3 years ago
Give two examples of situations or applications where resistors are used​
mart [117]

Answer:

Different Types of Resistors – Fixed, Variable, Linear and Non-Linear Resistors & Applications

  • Carbon Composition Resistors.
  • Wire wound Resistors.
  • Thin Film Resistors.
  • Carbon Film Resistors.
  • Metal Film Resistors.
  • Thick Film Resistors.
  • Metal Oxide Resistors.
  • Cermet Oxide Resistors (Network Resistors)
6 0
3 years ago
What is a computer program
Vlad1618 [11]

Answer:

computer program is a collection of instructions[1] that can be executed by a computer to perform a specific task.

A computer program is usually written by a computer programmer in a programming language. From the program in its human-readable form of source code, a compiler or assembler can derive machine code—a form consisting of instructions that the computer can directly execute. Alternatively, a computer program may be executed with the aid of an interpreter.

A collection of computer programs, libraries, and related data are referred to as software. Computer programs may be categorized along functional lines, such as application software and system software. The underlying method used for some calculation or manipulation is known as an algorithm.nation:

3 0
3 years ago
Convert 2989 to base 3​
kicyunya [14]

Answer:

11002201

Explanation:

It can be written as 1*3^7 +1*3^6+0*3^5+0*3^4+2*3^3+2*3^2+0*3^1+1*3^0

4 0
3 years ago
Other questions:
  • In evaluating a loop, you find the following statement:
    11·1 answer
  • Rikki has had several problems at work recently. Her printer isn't printing correctly, copies from the copy machine come out wit
    8·2 answers
  • Writing a program in a language such as c or java is known as _____ the program.
    10·1 answer
  • Alright, so im currently trying to pass a computer science class. i need it done in a little under 2 weeks. Ill just ask the one
    5·1 answer
  • Write a program whose input is a string which contains a character and a phrase, and whose output indicates the number of times
    6·1 answer
  • Suppose we want to adjust the page numbering for our Works Cited section so that it starts over at page 1. Is this possible to d
    12·2 answers
  • Ali is creating a document on a system using his login credentials. His colleague needs to use his system to access documents. H
    15·1 answer
  • Draw the tree that results when you add the values 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 to each of the following initially em
    15·1 answer
  • If a company gave you a free version of their software and encouraged you to try and improve it and share it with the only commu
    8·1 answer
  • A network administrator has asked robin, a network engineer, to use ospf (open shortest path first) along with rip (routing info
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!