コード例 #1
0
ファイル: Picture.php プロジェクト: shemoks/task2
 public function printProperties()
 {
     $s = parent::printProperties();
     $s .= 'Ширина: ' . $this->getWidth() . "см<br>\n";
     $s .= 'Висота: ' . $this->getHeight() . "см<br>\n";
     return $s;
 }
コード例 #2
0
ファイル: index.php プロジェクト: shemoks/task2
echo $discount . "<br>";
echo "<br>\n";
$history = new Book();
$history->setName("Історія");
$history->setCategory(0);
$history->setAuthor("З.Усова");
$history->setPrice(400);
$history->setAvailability(true);
$properties = $history->printProperties();
echo $properties;
$history->getCategory();
echo "Ціна зі знижкою:";
$discount = $history->discount();
echo $discount . "<br>";
echo "<br>\n";
$history = new Book();
$history->setName("Php.Обучение на примерах");
$history->setCategory(1);
$history->setAuthor("А.Кухарчик");
$history->setPrice(700);
$history->setAvailability(true);
$properties = $history->printProperties();
echo $properties;
$history->getCategory();
echo "Ціна зі знижкою:";
$discount = $history->discount();
echo $discount . "<br>";
echo "<br>\n";
echo "Картини<br>";
$picture = new Picture();
$picture->setName("Ліс");