#include #include using namespace std; const int EmployeSalarie=1, EmployeHeure=2, EmployeCommission=3; struct Employe { string nom; int EmployeType; float SalaireAnnuel; float TauxHoraire; float Commission; }; float CalculPayeSemaine (Employe &e, float HeuresTravaillees, float VentesTotales) { double x = 0.0; switch (e.EmployeType) { case EmployeSalarie: return e.SalaireAnnuel / 52; break; case EmployeHeure: return HeuresTravaillees * e.TauxHoraire; break; case EmployeCommission: return VentesTotales * e.Commission/100; break; } return x; } int main( ) { struct Employe e[3]; e[0].nom="Alain"; e[0].EmployeType=EmployeSalarie; e[0].SalaireAnnuel=52000.00; cout << e[0].nom << ':' << endl; cout << '$' << CalculPayeSemaine (e[0], 40, 0) << endl << endl; e[1].nom="Bertrand"; e[1].EmployeType=EmployeHeure; e[1].TauxHoraire=17.50; cout << e[1].nom << ':' << endl; cout << '$' << CalculPayeSemaine (e[1], 50, 8000) << endl << endl; e[2].nom="Michel"; e[2].EmployeType=EmployeCommission; e[2].Commission=5.00; cout << e[2].nom << ':' << endl; cout << '$' << CalculPayeSemaine (e[2], 10, 25000) << endl << endl; return 0; }