Question: Create a JavaScript that will display a polygon base on the given n-side . Then, the given n-sided regular polygon n, return the total sum
Create a JavaScript that will display a polygon base on the given n-side. Then, the given n-sided regular polygon n, return the total sum of internal angles (in degrees), display the polygon base on the given n-side, identify the polygon type.
complete code with pics for the final output
Examples
sumPolygon(3) 180
sumPolygon(4) 360
sumPolygon(6) 720
Notes
n will always be greater than 2.
The formula (n - 2) x 180 gives the sum of all the measures of the angles of an n-sided polygon.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
