private static void Main(string[] args) { Employe e1 = new Employe("ROCHER", "Oriane", 42, 1350); Employe e2 = new Employe("RENAUD", "Thierry", 33, 1550); Employe e3 = new Employe("BOSSE", "Antoinette", 27, 1450); Employe e4 = new Employe("QUINN", "Patrick", 32, 1570); Employe e5 = new Employe("LAVALLEE", "Samuel", 29, 1450); Chef c1 = new Chef("LEMELIN", "Armand", 45, 1835, "Logistique"); Chef c2 = new Chef("MIGNEAU", "Mallory", 44, 1840, "Informatique"); Directeur d1 = new Directeur("HARQUIN", "Noémie", 53, 2100, "Direction", "Happy Bear Investment"); Personne[] PersonneSociete = new Personne[] { e1, e2, e3, e4, e5, c1, c2, d1 }; Console.WriteLine("Liste des Employés de la Société"); for (int i = 0; i < PersonneSociete.Length; i++) { PersonneSociete[i].Afficher(); } PersonneSociete[1]++; c2.Salaire = 1900; c1.Service = "RH"; Console.WriteLine("\nNouvelle liste des Employés de la Société"); foreach (Personne personne in PersonneSociete) { personne.Afficher(); } }
static void Main(String[] args) { Personne[] tableauPersonnes = new Personne[8]; tableauPersonnes[0] = new Employé("marc", "durant", 20, 1400); tableauPersonnes[1] = new Employé("laurant", "dupont", 21, 1500); tableauPersonnes[2] = new Employé("jean", "dujardin", 22, 1600); tableauPersonnes[3] = new Employé("antoine", "martial", 23, 1700); tableauPersonnes[4] = new Employé("pierre", "gasly", 24, 1800); tableauPersonnes[5] = new Chef("dubois", "jean", 25, 1900, "manutention"); tableauPersonnes[6] = new Chef("dubois", "laurent", 26, 2000, "manutention"); tableauPersonnes[7] = new Directeur("boss", "the", 26, 5000, "manutention", "PrestaIT"); ++(tableauPersonnes[0]); ((Employé)tableauPersonnes[1]).setSalaire(9800); ((Chef)tableauPersonnes[5]).setService("cartons"); foreach (Personne personne in tableauPersonnes) { personne.Afficher(); } Console.ReadLine(); }