0.5], $density);
echo “Weight of the circle: ” . $circleWeight . ” kg\n”;
// Calculate weight of a cylinder with radius 0.5 meters and height 2 meters
$cylinderWeight = calculateWeight(‘cylinder’, [‘radius’ => 0.5, ‘height’ => 2], $density);
echo “Weight of the cylinder: ” . $cylinderWeight . ” kg\n”;
// Calculate weight of a rectangle with dimensions 1×0.5×0.2 meters
$rectangleWeight = calculateWeight(‘rectangle’, [‘length’ => 1, ‘width’ => 0.5, ‘height’ => 0.2], $density);
echo “Weight of the rectangle: ” . $rectangleWeight . ” kg\n”;
?>