33 lines
834 B
C#
Raw Permalink 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;
namespace Programmation_objet_TLESIO21.TD4 {
public class Employe : Collaborateur {
private int TauxHoraire;
private int NbHeures;
private readonly double T1 = 1.1;
public Employe(String nom, String birthdate, int tauxHoraire, int nbHeures) : base(nom, birthdate) {
this.TauxHoraire = tauxHoraire;
this.NbHeures = nbHeures;
}
2022-10-11 10:04:27 +02:00
public override double GetSalaire() {
2022-10-06 10:41:21 +02:00
double salaire = 0;
if(this.NbHeures > 35) {
2022-10-13 13:53:26 +02:00
salaire += (this.NbHeures - 35) * this.TauxHoraire * T1 * 4;
2022-10-06 10:41:21 +02:00
}
2022-10-13 13:53:26 +02:00
salaire += this.NbHeures * this.TauxHoraire * 4;
2022-10-06 10:41:21 +02:00
return salaire;
}
}
}