Slappy Joe's burgers is a high quality restaurant where burgers are priced after they are made using the exact weight of the meat that was used. Unfortunately, due to the level of creation time, it would be a massive drain on resources for them to make every single type of burger before they are ordered.
Instead of having every type of burger ready for someone to order, when someone orders the burger, it is made (if it isn't already) and they are charged the price for it.
The Burger.php
class is structured like this:
<?php class Burger { private $cheese; private $chips; private $price; public function __construct(bool $cheese, bool $chips) { $this->cheese = $cheese; $this->chips = $chips; $this->price = rand(1, 2.50) + ($cheese ? 0.5 : 0) + ($chips ? 1 : 0); } public function getPrice(): int { return $this->price; ...