print "El auto ya esta apagado<br>"; } } public function vaciarTanque() { $this->tanque = 0; } public function llenarTanque($cant) { $this->tanque = $cant; } public function usar($km) { if ($this->estado) { $reducir = $km / 3; $this->tanque = $this->tanque - $reducir; if ($this->tanque <= 0) { $this->estado = false; } } else { print "El auto esta pagado y no se puede usar <br>"; } } } $obj = new Deportivo(); //$obj->ver(); // Class Deportivo contains 4 abstract methods and must therefore be declared abstract or implement the remaining methods (gasolina::vaciarTanque, gasolina::llenarTanque, Auto::encender, ...) $obj->llenarTanque(100); $obj->encender(); $obj->usar(300); //$obj->usar(20); $obj->estado();