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
Help me im tired of posting
yaroslaw [1]

Stop posting this. It's very rude to continue posting this. One post was enough.

8 0
2 years ago
Read 2 more answers
Which of the following fractions has the same value as the decimal number 0.65?
boyakko [2]

Answer:

13/20

Step-by-step explanation:

To find this, divide 13 by 20 to get .65

Hope this helped!

4 0
3 years ago
(-4) x 5 + (-6)
Svetllana [295]

<h2>DOWNLOAD </h2><h2>THE</h2><h2>APP </h2><h2>PHOTOMATH </h2>

8 0
3 years ago
In 12 hours, how many more kilometers could the yellow car go than the red car? show your work
trasher [3.6K]

Answer:

144

Step-by-step explanation:

12 times 12

3 0
3 years ago
There are three blue marvels and five red marvels in a bag you randomly select a marble and put it it back in the back if you do
olga nikolaevna [1]

Answer:

25 times

Explanation:

Blue Marvels: 3

Red Marvels: 5

Total Marvels: 5 + 3 = 8 marvels

Probability: favorable outcomes/total outcomes

Probability - red marble =  5/8

After Doing 40 times:

= 5/8 × 40

= 25

7 0
2 years ago
Other questions:
  • An item is priced at $13.04. If the sales tax is 5%, what does the item cost including sales tax? If necessary, round to the nea
    7·2 answers
  • What is 3x+5x+2 factorised for yr 10 gcse
    10·1 answer
  • Translate the given phrase to an expression. Subtract 2/7 from 25/28. Do not simplify
    14·2 answers
  • Please help with this question.
    6·1 answer
  • Is this right? PLEASE HELP ASAP‼️‼️‼️
    11·1 answer
  • One third of a store’s inventory is children’s clothing. Two fifths of its inventory is women’s clothing. What fraction of the t
    14·2 answers
  • (-3,-5) (2,5) midpoint
    15·2 answers
  • What is the length of side a?
    9·1 answer
  • Which function represents the graph (what function is this)
    14·1 answer
  • Alberto is making a budget. He owes a cell phone bill of $60 per month for 23 more months, plus the fees for any extra usage suc
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!