2022-10-06 10:41:21 +02:00

33 lines
826 B
C#

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;
}
public override double getSalaire() {
double salaire = 0;
if(this.NbHeures > 35) {
salaire += (this.NbHeures - 35) * this.TauxHoraire * T1;
}
salaire += this.NbHeures * this.TauxHoraire;
return salaire;
}
}
}