Пример #1
0
    const FLAV3 = 'Strawberry';
    const FLAV4 = 'Mint';
    const FLAV5 = 'Superman';
    const SODA1 = 'Coke';
    const SODA2 = 'Sprite';
    const SODA3 = 'Fanta';
    private $typeDessert = "Float";
    private $discount = 5;
    public function getTypeDessert()
    {
        return "Type of Dessert: " . $this->typeDessert . "<br>";
    }
    public function availableFlavors()
    {
        return "Choose as many flavors as you would like: " . Float::FLAV1 . ", " . Float::FLAV2 . ", " . Float::FLAV3 . ", " . Float::FLAV4 . ", " . Float::FLAV5 . "<br>";
    }
    public function getSoda()
    {
        return "Choose a soda: " . Float::SODA1 . ", " . Float::SODA2 . ", " . Float::SODA3 . "<br>";
    }
    public function getDiscount()
    {
        return "You received a discount of " . $this->discount . "%<br><br>";
    }
}
//Float
$icFloat = new Float();
echo $icFloat->getTypeDessert();
echo $icFloat->availableFlavors();
echo $icFloat->getSoda();
echo $icFloat->getDiscount();