Answer to Question #261981 in Python for khaled

Question #261981

Instructions: You should submit your answer to this question as a Python code

with .py extension to the corresponding question in Google Classroom.

Attention: Make sure to write your name, surname, and student ID number.

Question:

 (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 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 ter

     The area of the pentagon is 108.61


1
Expert's answer
2021-11-06T11:48:16-0400
import math
r = eval(input('length from the center of a pentagon to a vertex '))
s = 2 * r * math.sin(math.pi / 5)
print(5*s**2/(4*math.tan(math.pi/5)))

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