This repository has been archived on 2025-10-20. You can view files and clone it, but cannot push or open issues or pull requests.
Files
2bki21/progp/25-3-26/schueler-class.php
2025-04-02 11:33:52 +02:00

39 lines
887 B
PHP

<?php
require_once "personen-class.php";
class Schueler extends Person{
// Attribute (Member)
private string $klasse;
// spezieller (parametrisierter) Konstruktor
public function __construct(string $vn, string $nn, string $kl) {
parent::__construct($vn, $nn);
$this->setKlasse($kl);
}
// Öffentliche Zugriffsfunktionen
// Setter
public function setKlasse(string $kl): void {
$this->klasse = $kl;
}
// Getter
public function getKlasse(): string {
return $this->klasse;
}
// Sonstige Funktionen
public function ausgabe() {
parent::ausgabe();
echo "Klasse: $this->klasse";
echo "</p>";
}
public function versetzen():bool{
if($this->klasse == "2BKI1"){
$this->klasse = "2BKI2";
return true;
}
return false;
}
}
?>