Implement the method calculateCircleArea
that takes the radius of a circle as a float
and returns its area.
Beginner Level
Math
Write a method to compute the area of a circle using the formula:
Area = π × radius²
- Use π = 3.14 for calculation.
- The radius is provided as a float input.
- The returned value should also be a float.
To calculate the area of a circle:
- Use the formula
Area = 3.14 × radius × radius
- Accept the radius as input
- Return the area as a float value
Pseudocode:
Function calculateCircleArea(radius):
return 3.14 * radius * radius