Collections - Exercice 5 - Énonce

Run Settings
LanguageC#
Language Version
Run Command
using System; using System.Collections.Generic; class MainClass { static void Main() { // Instanciation de la liste List<Client> clients = new List<Client>(); // Instanciation et ajout des "vrais" clients clients.Add(new Client("Schlitz", "Thérèse", "Strasbourg")); clients.Add(new Client("Dupont", "Jean", "Pfuelgricheim")); clients.Add(new Client("Dreisht", "Marc", "Pfuelgricheim")); clients.Add(new Client("Brotz", "Elena", "Pfuelgricheim")); clients.Add(new Client("Lopez", "Simon", "Paris")); // Instanciation et ajout des "faux" clients for(int i = 0; i < 5; i++) { clients.Add(new Client("None", "None", "")); } /* TODO : Supprimer les faux clients et corriger le nom des villes "Pfuelgricheim" */ } }
public class Client { private string nom; private string prenom; private string ville; public Client(string nom, string prenom, string ville) { this.nom = nom; this.prenom = prenom; this.ville = ville; } public string Nom { get { return nom; } } public string Prenom { get { return prenom; } } public string Ville { get { return ville; } set { ville = value; } } }
Editor Settings
Theme
Key bindings
Full width
Lines