commit classe étudiant

This commit is contained in:
BRAMAS Arthur
2025-09-29 12:06:38 +02:00
parent 387e1eb5e4
commit 43108907a3
2 changed files with 52 additions and 0 deletions

47
Etudiant.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
class Etudiant {
private $nom;
private $prenom;
private $age;
public function __construct(String $Nom, String $Prenom, int $Age) {
$this->nom = $Nom;
$this->prenom = $Prenom;
$this->age = $Age;
}
public function getNom() {
return $this->nom;
}
public function setNom($Nom) {
$this->nom = $Nom;
}
public function getPrenom() {
return $this->prenom;
}
public function setPrenom($Prenom) {
$this->prenom = $Prenom;
}
public function getAge() {
return $this->age;
}
public function setAge($Age) {
$this->age = $Age;
}
public function getEtudiant() {
"<br/>";
echo"infos étudiant : "."<br/>";
echo"prenom étudiant : ".$this->getPrenom()."<br/>";
echo"nom étudiant : ".$this->getNom()."<br/>";
echo"age étudiant : ".$this->getAge()."<br/>";
}
}

View File

@@ -1,5 +1,10 @@
<?php
include "script2.php";
include "Etudiant.php";
echo "ICI SCRIPT 1 <br>";
$etudiant1 = new Etudiant("test","test",8);
echo $etudiant1->getEtudiant();