Focus mode
Özellikleri
<?php
abstract class Urun
{
public $fiyat;
public $vergi;
public $urunAdi;
abstract public function urunAdi($urunAdi);
abstract public function urunVergi($vergi);
abstract public function urunFiyat($fiyat);
public function urunEkle()
{
echo $this->urunAdi . ' isimlü ürün KDV(' . $this->vergi . '%) dahil ' . ($this->fiyat + (($this->fiyat / 100) * $this->vergi)) . ' eklendi.';
}
}
class Icecek extends Urun
{
public function urunAdi($urunAdi)
{
$this->urunAdi = $urunAdi;
}
public function urunVergi($vergi)
{
$this->vergi = $vergi;
}
public function urunFiyat($fiyat)
{
$this->fiyat = $fiyat;
}
}
$Icecek = new Icecek();
$Icecek->urunAdi('Kola');
$Icecek->urunVergi(18);
$Icecek->urunFiyat(10);
$Icecek->urunEkle();
Programs to Accelerate Your Progress in a Software Career
Join our 4-8 month intensive Patika+ bootcamps, start with the fundamentals and gain comprehensive knowledge to kickstart your software career!
You need to enroll in the course to be able to comment!