Precision Area
EasyAcc. 95.4%
+20 XP 8
Circular Boundaries
As a geometry engineer, you must calculate the area of circular containment fields. Accuracy is paramount, as a deviation of even a fraction could compromise the field.
The formula for the area of a circle is: Area = PI * radius².
- Declare a constant named
PIand set it to 3.14159. - Calculate the area by multiplying
PIby the square of theradius. - Return the resulting number.
01EXAMPLE 1
Input
radius = 5Output
78.53975Explanation: 3.14159 * 5 * 5 = 78.53975
Constraints
- Use const for PI.
- Numerical tolerance (1e-7) is handled by the platform.
FundamentalsMathConstants
JavaScriptSystem handles I/O — write your function only
Loading...
9 Hidden
Input Arguments
radius5
Expected Output
78.53975
Click RUN to test your solution