diff --git a/psychorientation/psychorientation/GestionnaireEleve.cs b/psychorientation/psychorientation/GestionnaireEleve.cs index 03278a415efe3e3f4d491709165ac321b8c77f2e..fad4253bdfac549d54dd103668c469a00038cbf4 100644 --- a/psychorientation/psychorientation/GestionnaireEleve.cs +++ b/psychorientation/psychorientation/GestionnaireEleve.cs @@ -10,9 +10,7 @@ namespace psychorientation { private List<Eleve> listeEleves = new List<Eleve>(); - public GestionnaireEleve() - { - } + public GestionnaireEleve() {} public void AjouterEleve(Eleve e) { diff --git a/psychorientation/psychorientation/eleve.cs b/psychorientation/psychorientation/eleve.cs index c4bd38f1954c26014743558a179374ba44051636..74a855fc5f7eb2199a0c31b586c396b15d7a24ac 100644 --- a/psychorientation/psychorientation/eleve.cs +++ b/psychorientation/psychorientation/eleve.cs @@ -86,11 +86,10 @@ namespace psychorientation return this.appreciation; } - - public double GetMoyenne() { - double res = -1; + if (this.listeNotes.Count == 0) {return -1;} + double res = 0; if (this.listeNotes.Count > 0) { foreach(Note n in listeNotes) @@ -98,13 +97,14 @@ namespace psychorientation res += n.getNote(); } } - return res/ this.listeNotes.Count; + return res / this.listeNotes.Count; } + public void AjouterNote(string nom) { - Note n = new Note(nom,CalculerNote() , this.competence, this.effort); + Note n = new Note(nom, CalculerNote(), this.competence, this.effort); this.listeNotes.Add(n); }