Computers and Technology, 17.12.2020 17:50 breiajanae880
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()
Answers: 1
Computers and Technology, 22.06.2019 13:30
Write lines of verse that rhyme to remember the following information: acid rain is a type of air pollution caused by chemicals in the air.
Answers: 1
Computers and Technology, 23.06.2019 04:31
Acloud service provider uses the internet to deliver a computing environment for developing, running, and managing software applications. which cloud service model does the provider offer? a. iaas b. caas c. maas d. paas e. saas
Answers: 1
Computers and Technology, 23.06.2019 18:30
Where can page numbers appear? check all that apply. in the header inside tables in the footer at the bottom of columns at the top of columns
Answers: 1
Computers and Technology, 23.06.2019 19:30
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
You will create a program that will take in the values of 3 sides of a triangle and determine if tha...
Engineering, 20.10.2020 05:01
English, 20.10.2020 05:01
Mathematics, 20.10.2020 05:01
Mathematics, 20.10.2020 05:01
Mathematics, 20.10.2020 05:01
English, 20.10.2020 05:01
Mathematics, 20.10.2020 05:01
English, 20.10.2020 05:01
Mathematics, 20.10.2020 05:01
Biology, 20.10.2020 05:01
English, 20.10.2020 05:01
Mathematics, 20.10.2020 05:01