Garden Fence
JavaScript
20 pts
Garden Fence
Selam has a round garden with a radius of 4 metres. Calculate:
area— π × radius², rounded to 2 decimalsfence— the distance around the garden, 2 × π × radius, rounded to 1 decimalpacks— fence is sold in packs of 3 metres. How many packs does she need? (She must have enough!)
Use Math.PI. Print exactly:
Area: 50.27 Fence: 25.1 Packs: 9
Checklist
- Calculate
arearounded to 2 decimals. - Calculate
fencerounded to 1 decimal. - Calculate
packsso there is always enough fence. - Use
Math.PIandMath.ceil(), no typed answers. - Print the three labelled lines.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
