Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * Create a function called `calculateArea()` that takes one argument, the
- * diameter of a circle. The function should return the area of the circle,
- * with 4 decimals.
- *
- * Answer with the result if the diameter is 17. ( hint: `pi()` )
- *
- * Write your code below and put the answer into the variable ANSWER.
- */
- function calculateArea($arg1)
- {
- $area = PI() * ($arg1 ** 2) / 4;
- $with4decimals = round($area, 4);
- return 'hint: ' . $with4decimals;
- }
- $ANSWER = calculatedArea(17);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement