예제 #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
$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("Ліс");
$picture->setAuthor("Корольов");
$picture->setAvailability(false);
$picture->setCategory(0);
$picture->setHeight(500);
$picture->setWidth(250);
$picture->setPrice(200);