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
nata0808 [166]
3 years ago
12

Read 3 integer numbers from the user; these numbers represent the lengths of 3 straight lines. From the 3 lengths, determine whe

ther a triangle can be formed with the corresponding lines. If it is possible to form a triangle, determine whether the triangle is a right triangle or not. The rules to be used are: 1. To form a triangle where all lines’ ends meet (form vertices), the sum of the lengths of two sides must be greater than the length of the third side. This short video illustrates this concept: How to determine if the three sides make up a triangle. 2. Per the Pythagorean theorem: in a straight triangle, the square of the length of the longest side (the hypotenuse) is equal to the sum of the squares of the lengths of the other two sides. 3. The user can enter the lengths of each line in any order, i.e.: you may not assume that the first length is the longest or the smallest or the middle value.
Mathematics
1 answer:
Elza [17]3 years ago
4 0

Answer:

Written in Python

print("Enter three sides of a triangle: ")

length = []

for i in range(0,3):

    inp = int(input(""))

    length.append(inp)    

length.sort()

if length[1]+length[2] > length[0] and length[0] + length[2] > length[1] and length[0] + length[1] > length[2]:

    print("Triangle")

    if length[2]**2 == length[0]**2 + length[1] **2:

         print("Right Angled")

    else:

         print("Not Right Angled")

else:

    print("Not Triangle")

Step-by-step explanation:

This line prompts user for sides of triangle

print("Enter three sides of a triangle: ")

This line declares an empty list

length = []

The following iteration gets user input

<em>for i in range(0,3):</em>

<em>     inp = int(input(""))</em>

<em>     length.append(inp)    </em>

This line sorts user input

length.sort()

The following if condition checks if user input is triangle

if length[1]+length[2] > length[0] and length[0] + length[2] > length[1] and length[0] + length[1] > length[2]:

The following is executed is the if condition is true

    print("Triangle")

The following if condition checks if user input forms a right angled triangle

<em>     if length[2]**2 == length[0]**2 + length[1] **2:</em>

<em>          print("Right Angled")</em>

<em>     else:</em>

<em>          print("Not Right Angled")</em>

This is executed if user input is not a triangle

<em>else:</em>

<em>     print("Not Triangle")</em>

<em></em>

You might be interested in
What is 1.0836 rounded to the nearest thousandth
sp2606 [1]
1.084 because it goes tenths hundredths thousands
4 0
4 years ago
Read 2 more answers
How to do linear functions using the table ?
Ira Lisetskai [31]

Answer:

-8 = m-2+b

-2 = m-0+b

4 = m2+b

10 = m4+b

Step-by-step explanation:

You just put them in y = mx+b format

3 0
3 years ago
Select all the correct answers.<br> Which triples are Pythagorean triples?
Fittoniya [83]

The answer is in the picture below

3 0
3 years ago
Use The Scale Factor 1:12 To Find The Missing Dimension
adell [148]

Answer:

The length of the model is 21 inches

Step-by-step explanation:

we have

The scale factor

\frac{1}{12}

That means

1 unit in the model represent 12 units in the actual

1 inch in the model represent 12 inches in the actual

Remember that

1\ ft=12\ in

so

1 inch in the model represent 1 ft in the actual

The scale factor is

\frac{1}{1}\ \frac{in}{ft}

therefore

21 ft in the actual represent 21 inches in the model

6 0
3 years ago
Which of the following is the best estimate of 31% of 15?<br> 7.5<br> 3<br> 5<br> 4
Alex777 [14]
Th answer is 5 because 31% of 15 is 4.65
3 0
3 years ago
Read 2 more answers
Other questions:
  • Sound travels through the air different materials at different speeds. The graph shows that one second, sound travels 5971 meter
    13·1 answer
  • 3.75 yards equals how many inches
    8·2 answers
  • Who do yo write 6,007,200 in two other forms
    15·1 answer
  • In a lab, scientists are growing a culture of bacteria. It is known that the
    12·1 answer
  • Please Helpppppppp with this question
    11·1 answer
  • X- 0.1x + 2.70 = 56.70 solve for the answer
    8·1 answer
  • A family has two cars. The first car has a fuel efficiency of 15 miles per gallon of gas and the second has a fuel efficiency of
    14·2 answers
  • What is the following sale price for a phone charger with an original price of $1.99 after applying a discount of 20%
    11·1 answer
  • Solve the system of linear equations by substitution.
    6·2 answers
  • Maria cut a rectangular piece of fabric. The area was 8/10 of a meter. The width was 6/10 of a meter. What was the length of the
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!