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².

  1. Declare a constant named PI and set it to 3.14159.
  2. Calculate the area by multiplying PI by the square of the radius.
  3. Return the resulting number.

01EXAMPLE 1

Inputradius = 5
Output78.53975

Explanation: 3.14159 * 5 * 5 = 78.53975

Constraints

  • Use const for PI.
  • Numerical tolerance (1e-7) is handled by the platform.
FundamentalsMathConstants
JavaScript
Loading...
9 Hidden

Input Arguments

radius5

Expected Output

78.53975

Click RUN to test your solution