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
Sholpan [36]
3 years ago
12

In this assignment, you will write a Python 3.x program to calculate the length of the hypotenuse (side C) of a right triangle,

given the lengths of the other two sides (A & B) as provided by the user. The program will also calculate the area of the triangle and the perimeter (the sum of the three sides). Other specifications: WRITE THE CODE FOR THE ANSWER.
Computers and Technology
1 answer:
zvonat [6]3 years ago
5 0

Answer:

Explanation:

from math import hypot #import hypot for finding the hypotenuse

a = int(input("Enter a value for a: " )

b = int(input("Enter a value for b: " )

def find_hypotenuse(a,b):

return hypot(a,b) #find the hypotenuse

def find_area(a,b):

return 0.5 * a * b #calculate the area

def find_perimeter(a,b):

return a + b + find_hypotenuse(a,b) #calculate the perimeter

print("the hypotenuse is :", find_hypotenuse(a,b))

print("the area is :", find_area(a,b))

print("the perimeter is :", find_perimeter(a,b))

You might be interested in
A _______ is a piece of computer hardware used for the modulation and demodulation of data between digital and analog formats.
mario62 [17]
'Modem'. A hardware that changes analogy to digital and vice versa.
5 0
3 years ago
Which are guidlines for using themes? Check all that apply
Andreyy89

Answer: A. Using different cell styles can help you differentiate different types of data.

B. Fonts should be easily readable and of appropriate size.

D. Be consistent with themes across worksheets and workbooks.

Explanation:

A theme refers to the preset package that contains functionality details and graphical appearance.

The guidelines for using themes include:

• Using different cell styles can help you differentiate different types of data.

• Fonts should be easily readable and of appropriate size.

• Be consistent with themes across worksheets and workbooks.

Therefore, the correct options are A, B and D.

7 0
3 years ago
What is output by the following C# code segment?int temp;temp = 180;while ( temp != 80 ) {if ( temp > 90 ) {Console.Write( "T
Artemon [7]

Answer:

This porridge is too hot! This porridge is just right!

Explanation:

I am going to explain every line of the given C# code to give explanation of the output.

  • The first statement int temp declares a variable temp.
  • Then the temp variable is assigned a value 180.
  • The block of statement in while loop body will keep executing until the value in temp variable gets equal to 80. The while loop first checks if the value of temp is not equal to 80. As the value of temp=180 which is not equal to 80, this means that the condition of while loop evaluates to true so the block of code in the body of the loop is reached.
  • There is an if condition inside while loop which checks if the value in temp variable is greater than 90. As value of temp=180 which is greater than 90 so the condition is true.
  • As the condition in the if statement evaluates true so the block of code which is the part of this if statement will be executed:

             {Console.Write( "This porridge is too hot! " );

                  temp = temp – ( temp > 150 ? 100 : 20 ); }

  • The first statement is executed which displays this message: This porridge is too hot!
  • Next   temp = temp – ( temp > 150 ? 100 : 20 ); statement will change the value of temp. It has the conditional operator which works as follows:

                 Here, temp>150 is the condition to be evaluated.

  • If this condition is True then 100 will be returned else 20 will be returned. The value returned is then subtracted from the value of temp and the subtraction result will become the new value of temp. As the value of temp which is 180 is greater than 150 so 100 is returned and is subtracted from the value of temp (180).

                                        temp= 180-100

                                             temp=80

  • So the new value of temp is 80.
  • The else part will not be executed because the condition in if statement was true and also we can see that temp is not less than 70. It means that the porridge is too cold part will not be executed.
  • The while loop while(temp!=80) will again be checked. As the new value of temp is now 80, so the condition gets false which breaks the while loop and program control will leave the body of while loop.
  • After the control comes out of the while loop, there is another if statement. This statement checks if the value of temp variable is equal to 80. It is true as the new value of temp is now 80 after that execution of while loop block of code.
  • As the if condition evaluates to true the statement

                    Console.WriteLine( "This porridge is just right!" );

       will be executed which displays the message:

                                  This porridge is just right.

  • Hence the output of the given code is:

           This porridge is too hot! This porridge is just right!

7 0
3 years ago
Plymouth Colony was originally founded by a group of people called Pilgrims. Since Plymouth did not have an official charter fro
quester [9]

Plymouth Colony was originally founded by a group of people called Pilgrims. Since Plymouth did not have an official charter from England, its government was based on which document? U.S. Constitution Fundamental Orders of Connecticut Articles of Confederation Mayflower Compact.

5 0
3 years ago
Which of the following is NOT a factor of identifying graphic design?
kolezko [41]

Answer:

i think it is a

Explanation:

sorry if it is wrong

4 0
3 years ago
Read 2 more answers
Other questions:
  • Someone who wants the credentials of skilled training, but in less time than a four-year degree should consider
    11·1 answer
  • What are the two houses in Congress?
    5·1 answer
  • An Internet connection problem for customers is found to be outside a carrier's regional office. As a result, which area needs t
    9·1 answer
  • Practice problems on functions. Write C function(s) to carry out the specified tasks. For each problem, also write the suggested
    15·1 answer
  • Consider a system consisting of m resources of the same type, being shared by n processes. Resources can be requested and releas
    9·1 answer
  • PLEASE HELP what is the mechanical advantage of a wheel with a radius of 8.0 cm connected with a axle with a radius of 2.5 cm?
    12·2 answers
  • Write a C function which takes three parameters which are the cost for an item in a grocery store, the quantity to buy, and the
    12·2 answers
  • Kali, a Python programmer, is using the turtle module to write the word "hello." Which code should she use to indicate the locat
    9·2 answers
  • 80billion +2 TRILLION . PLEASE AWNSER
    7·1 answer
  • What social media profession entails determining how and in what way an organization will create and maintain a social media pre
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!