if (String.IsNullOrWhiteSpace(value))
throw new ArgumentException("nom invalide");
if (value == null || value.Length == 0)
throw new ArgumentException("notes invalides");
public Bulletin(string nomInit, float[] notesInit)
public string GénérerReprésentationTextuelle()
string entête = $"Nom : {Nom}\nNotes : ";
StringBuilder sb = new StringBuilder(entête, entête.Length + Notes.Length * 5);
int nNotes = Notes.Length;
for (int i = 0; i < nNotes - 1; ++i)
sb.Append($"{Notes[i]}, ");
sb.Append($"{Notes[nNotes - 1]}");
public static void Main()
Bulletin b1 = new Bulletin("Gagnon", new float[]{50f, 100f});
Console.WriteLine(b1.GénérerReprésentationTextuelle());