diff --git a/Suli/13.b/Backend/2024. 10. 24/Vera.ttf b/Suli/13.b/Backend/2024. 10. 24/Vera.ttf new file mode 100644 index 0000000..58cd6b5 Binary files /dev/null and b/Suli/13.b/Backend/2024. 10. 24/Vera.ttf differ diff --git a/Suli/13.b/Backend/2024. 10. 24/head.php b/Suli/13.b/Backend/2024. 10. 24/head.php index 510b44f..bb033c2 100644 --- a/Suli/13.b/Backend/2024. 10. 24/head.php +++ b/Suli/13.b/Backend/2024. 10. 24/head.php @@ -1,6 +1,17 @@ nev = $nev; + $this->kor = $kor; + } + + public function adjegy($jegy) { + $this->jegyek[] = $jegy; + } + + public function atlagkiszamit() { + if (count($this->jegyek) == 0) { + return 0; + } + + else { + return array_sum($this->jegyek) / count($this->jegyek); + } + } + + public function adatkiir() { + $atlag = $this->atlagkiszamit(); + echo "Név: {$this->nev}, Kor: {$this->kor}, Átlag: {$atlag}"; + } + } + + $tan1 = new Tanulo("Kis Péter", 15); + $tan1->adjegy(5); + $tan1->adjegy(1); + $tan1->adjegy(3); + $tan1->adjegy(2); + $tan1->adatkiir(); + + + +?> \ No newline at end of file