using System.Collections.Generic;
public interface IStats {
public string Nom { get; set; }
public string Prenom { get; set; }
public Eleve Eleve { get; set; }
public double Valeur { get; set; }
public class ListeDeNotes : IStats {
public string Matière { get; set; }
public Note [] Notes { get; set; }
public double moyenne = -1;
public double ecartType = -1;
public ListeDeNotes(string matière, Note[] notes) {
foreach( Note not in notes)
Console.WriteLine("Nom : " + not.Eleve.Nom + " Prenon : " + not.Eleve.Prenom + " heeft als valeur : " + not.Valeur);
for (int i = 0; i < Notes.Length; i++) {
somme += Notes[i].Valeur;
if (Notes.Length != 0) moyenne = somme / Notes.Length;
public double EcartType() {
if (ecartType != -1) return ecartType;
double moyenne = Moyenne;
for (int i = 0; i < Notes.Length; i++) {
carrés += Math.Pow((Notes[i].Valeur - moyenne), 2);
ecartType = Math.Sqrt(carrés / Notes.Length);
public void Ajouter(Note note) {
public static void Main()
Console.WriteLine("Hello World");
Eleve [] eleve = {new Eleve { Nom = "Mo", Prenom = "eLboubk"},
new Eleve { Nom = "Mo", Prenom = "eLboubk"},
new Eleve { Nom = "Mo", Prenom = "eLboubk"}};
Note[] notes1 = { new Note { Eleve = eleve[0], Valeur = 14 },
new Note { Eleve = eleve[1], Valeur = 16 },
new Note { Eleve = eleve[2], Valeur = 18 } };
ListeDeNotes li = new ListeDeNotes("francais", notes1);
ListeDeNotes not = new ListeDeNotes("francais", notes1);
Console.WriteLine("gemiddlede " + not.Moyenne + " Ecarttype : "+ not.EcartType() + " en " + not.Matière);