Area of a Circle

Home

Part 1

Create a JavaScript function called calculateCircleArea that takes an input parameter called radius, and returns the corresponding area.

Invoke the function, passing a radius of 9, and store the resulting area in a variable. Log both the radius and the corresponding area to the console.

HINT: the formula for circle area is:
\[ A = \pi r^{2} \]


Part 2

See the numeric radius input box and "Calculate" button below. Write JavaScript code to respond to button click events, and when the button is clicked, the program should calculate the area for the given radius (using the function from Part 1), and finally then display the area in the designated span element.


TODO