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
eremy loves movies. He likes to watch movies and someday he hopes to make one of his own. He likes to ask questions about movies
IrinaVladis [17]
One movie-related statistical question would be the length of people's favorite movies (in minutes). This would contain variability since people would have different favorite movies, which would have different lengths.
One movie-related question that does not yield variability is the number of movies released in 2018 that grossed more than $100 million. This would be a fixed fact, so there is no variability about this.

8 0
3 years ago
A 2-pound box of spaghetti costs $2.50. Philip says that the unit cost is 2 over 250 = $0.80 per pound. Explain his error
7nadin3 [17]
Phillip forgot to put a period between 2 and 50
4 0
3 years ago
Jade only need 3 1/4 cans of paint
notsponge [240]
What else do you need help with
5 0
3 years ago
Read 2 more answers
Which expression is equivalent to |1-5| + |3|?<br><br><br> O -2<br><br> O -8<br><br> O 2<br><br> O 8
vfiekz [6]

Answer:

8

Step-by-step explanation:

because you do |1-5| first then do add ur answer to |3|

3 0
3 years ago
Find f(-2) if f(x) =x^4 +2x^2-1
Ierofanga [76]

Answer:

Plug -2 in for x of f(x)

--> -2^4 + 2(-2)^2 - 1

---> 23

f(-2) = 23

4 0
3 years ago
Read 2 more answers
Other questions:
  • Two cables were attached to the top of a pole and anchored to the ground on opposite sides of the pole. What is the length of th
    9·1 answer
  • Mariya is solving the quadratic equation by completing the square.
    5·2 answers
  • A particular style of jacket costs the retailer $85 per jacket. At what price should the retailer mark them so he can sell them
    11·1 answer
  • Solve for y. 2.4x -1.5y=3
    6·2 answers
  • Solve X - 3/4 = 1 1/8
    13·1 answer
  • Identify the domain of the function.
    10·1 answer
  • Olivia wrapped a string around a circle and found it was 30 mm long. Approximately, what is the radius of this circle
    10·1 answer
  • Meteorology: The temperature is 8 degrees. It is expected to fall 5 degrees each hour for the next several hours. In how many ho
    14·1 answer
  • Katerina is making picture frames
    14·2 answers
  • What are some examples of a linear system
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!