I am no native speaker, so sometimes I struggle with finding words. Or don’t see why others don’t understand them.
In PHP track we use pizza-pi
as a concept exercise. In task 3 we show a formula to calculate. It somehow resembles the area of a circle. So people again and again want “to fix the formula”.
Now I want to add the hint, that covering a pizza with a gap-less circle of monolithic cheese is not what Lilly wants to do. Instead she uses another formula. Is that understandable enough? Or does it add more to the weirdness?
Here’s the task description I want to use:
## 3. Some Cheese, Please
Cheese comes in perfect cubes and is sold by size.
Lilly does not cover the whole pizza area with a monolithic gap-less layer of cheese.
She decided to use the following formula to determine how many pizzas of some diameter (`diameter`) can be made from a cheese cube of side-length (`cheese_dimension`):
`pizzas = (cheese_dimension³) / (thickness * PI * diameter)`
Create a function that:
- Takes a side-length dimension of a cheese cube
- Takes the desired thickness of the cheese layer
- Takes the diameter of the pizza
- And uses Lilly's formula to return the number of pizzas that can be made while rounding down.
For example, given a 25x25x25cm cheese cube, 0.5cm thick cheese layer and pizzas 30cm in diameter:
'''php
<?php
$pizza_pi = new PizzaPi();
$pizza_pi->calculateCheeseCubeCoverage(25, 0.5, 30);
// => 331
'''