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
Can someone please help super short
insens350 [35]

Answer:

542, 543, 544, 545.

Step-by-step explanation:

Divide 2174 by 4 = 543.5  

(because there are 4 integers) 543.5 is not an integer.

However, one of the four integers is 543.

Write down four consecutive numbers that include 543 and add them:  

like 541+542+543+544 =. if that is 2174, you have the answer, if it's too low, try moving up one number, like

542+543+544+545 = if it's still too low, move up one number again  

543+544+545+546=  

You only have to do that a max of 3 times to get the answer.

The four consecutive integers are  

542, 543, 544, 545.

<em>good luck, hope this helps :)</em>

3 0
3 years ago
Read 2 more answers
−5/9x+3.2=5 please help !!!
Lemur [1.5K]
The answer is -3.24
7 0
2 years ago
Read 2 more answers
George weighs twice as much as his little brother Sam.
german
74 pounds because sam weight 37
37x2 = 74
8 0
3 years ago
Read 2 more answers
PLEASE ANSWER WITH SOLUTIONS. THX! I NEED IT ASAP!!
Diano4ka-milaya [45]
I think the first one might be 18 second might be 10
4 0
3 years ago
Can I get some help I’ll mark brainliest
iren2701 [21]
Itzzzzz 13/15 in simplest form
4 0
2 years ago
Other questions:
  • Solve this polynomial:
    14·1 answer
  • Two numbers multiply together to make 8 but add together to make 6. What are the two numbers?
    6·1 answer
  • The sides of a square are increased by a scale factor of 2. The area of the larger square is what percent of the area of the sma
    11·1 answer
  • Martina walked of a mile in of an hour. At this rate, how far can Martina walk in one hour
    9·2 answers
  • Greatest common factor of 12, 60, and 68
    11·1 answer
  • What is the median for the following data set? 5,7,9,11,13,13
    15·1 answer
  • What is 28900 divided by 945600
    14·2 answers
  • Does any one know the answer
    5·1 answer
  • PLEASE PLEASE PLZZ HELP :(((((
    6·2 answers
  • On Elisa's birthday, her mom made a chocolate cake. After the party, 2/3 of the cake was left. The next day, Elisa ate 1/3 of wh
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!