From e5cbe62330279ebd4b3c36f4a1af01fbee6776d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20F=C3=A9lix?= <felixantoine67@yahoo.fr> Date: Wed, 1 Apr 2020 16:20:53 +0200 Subject: [PATCH] Corrections de "Eleve.cs". --- psychorientation/psychorientation/GestionnaireEleve.cs | 4 +--- psychorientation/psychorientation/eleve.cs | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/psychorientation/psychorientation/GestionnaireEleve.cs b/psychorientation/psychorientation/GestionnaireEleve.cs index 03278a4..fad4253 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 c4bd38f..74a855f 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); } -- GitLab