示例#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("Ліс");