subject

You will create a program that will take in the values of 3 sides of a triangle and determine if that triangle is a right triangle by using the Pythagorean Theorem. I have provided the pseudocode for you below. All you need to do is translate the pseudocode to a Python program that will run and output correctly if the user has entered a Pythagorean triple or not..

You can test your program by entering the following values:

Enter 12, 5, 13 and it should tell you “Yes! You have a right triangle.”
Enter 5, 7, 10 and it should tell you “No! You DO NOT have a right triangle.”

PROCEDURE getSides()

{

>

DISPLAY (What is the length of the first side?)

side1 ← INPUT()

DISPLAY (What is the length of the second side?)

side2 ← INPUT()

DISPLAY (What is the length of the third side?)

side3 ← INPUT()

}

PROCEDURE decideHypotenuse()

{

>

IF ((side1 > side3) AND (side1 > side2))

{

hypotenuse ← side1;

leg1 ← side2;

leg2 ← side3;

}

ELSE

{

leg1 ← side1;

IF (side2 > side3)

{

hypotenuse ← side2;

leg2 ← side3;

}

ELSE

{

hypotenuse ← side3;

leg2 ←side2;

}

}

}

PROCEDURE isItRight()

{

IF ((leg1 * leg1 ) + (leg2 * leg2 ) == (hypotenuse * hypotenuse ))

{

DISPLAY (Yes! You have a right triangle.)

}

ELSE

{
DISPLAY (No! You DO NOT have a right triangle.)

}

}

getSides()
decideHypotenuse()
isItRight()

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
3. what do the terms multipotentialite, polymath, or scanner mean?
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Append and make table queries are called queries. select complex simple action i think action
Answers: 1
You know the right answer?
You will create a program that will take in the values of 3 sides of a triangle and determine if tha...
Questions
question
Medicine, 13.01.2021 07:00
question
Mathematics, 13.01.2021 07:00
question
Mathematics, 13.01.2021 07:10
question
Mathematics, 13.01.2021 07:10
Questions on the website: 13722363