Answer to Question #262371 in Python for khaled

Question #262371

(Geometry: area of a pentagon) Write a program that prompts the user to enter the

length from the center of a pentagon to a vertex and computes the area of the pen-

tagon, as shown in the following figure.

                               3V3

    The formula for computing the area of a pentagon is Area =

                               2

                                  where s is

    the length of a side. The side can be computed using the formula s = 2r sin

    where r is the length from the center of a pentagon to a vertex. Here is a sample

    run:

    Enter the length from the center to a vertex: 5.5

    The area of the pentagon is 108.61

                                JEnter


1
Expert's answer
2021-11-11T01:09:28-0500
from math import sin, pi, sqrt


a = float(input("Enter the length from the center to a vertex: "))
s = 2 * a * sin(pi/5)
area = ((3*sqrt(3))/2)*s**2
print("The area of the pentagon is", round(area,2))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS