50 lines
1.9 KiB
C#
Raw Normal View History

2022-10-06 10:41:21 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Programmation_objet_TLESIO21.TD3.fleuriste;
namespace Programmation_objet_TLESIO21.TD4 {
public static class TD4 {
public static void Exo1() {
TabCollaborateur tab = new TabCollaborateur();
Employe e1 = new Employe("Lejaune", "13051956", 20, 30);
Employe e2 = new Employe("LeBlanc", "20051970", 15, 100);
Manager m1 = new Manager("LeRouge", "14011998", 2500, 150);
Manager m2 = new Manager("LeVert", "29101987", 3000, 200);
Commercial c1 = new Commercial("LeNoir", "29011987", 4000, 30000);
Commercial c2 = new Commercial("LeViolet", "29011987", 3000, 30000);
tab.Add(c1);
tab.Add(e1);
tab.Add(m1);
tab.Add(e2);
tab.Add(m2);
tab.Add(c2);
Console.WriteLine("COLLABORATEUR AYANT PLUS HAUT SALAIRE");
Console.WriteLine(tab.PlusHautSal());
Console.WriteLine("EMPLOYE AYANT PLUS HAUT SALAIRE");
Console.WriteLine(tab.PlusHautSal("Employe"));
Console.WriteLine("MANAGER AYANT PLUS HAUT SALAIRE");
Console.WriteLine(tab.PlusHautSal("Manager"));
Console.WriteLine("COMMERCIAL AYANT PLUS HAUT SALAIRE");
Console.WriteLine(tab.PlusHautSal("Commercial"));
Console.WriteLine("TRI SUR AGE ");
tab.Sort();
2022-10-11 10:04:27 +02:00
foreach(Collaborateur c in tab.GetCollaborateurs())
Console.WriteLine(c.ToString());
2022-10-06 10:41:21 +02:00
Console.WriteLine("TRI SUR SALAIRE ");
2022-10-11 10:04:27 +02:00
tab.Sort("salaire");
foreach(Collaborateur c in tab.GetCollaborateurs())
Console.WriteLine(c);
2022-10-06 10:41:21 +02:00
}
public static void Launch() {
2022-10-11 10:04:27 +02:00
Exo1();
2022-10-06 10:41:21 +02:00
}
}
}