LP21-Programmation-objet/TD4/Collaborateur.cs
2022-10-11 10:04:27 +02:00

34 lines
839 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 Collaborateur {
private readonly String NOM;
private String DateNaissance;
public Collaborateur(String nom, String birthdate) {
this.NOM = nom;
this.DateNaissance = birthdate;
}
public override string ToString() {
return this.NOM + " - Age " + this.GetAge() + " - Salaire " + this.GetSalaire();
}
public virtual double GetSalaire() {
return .0;
}
public String GetName() {
return this.NOM;
}
public int GetAge() {
return 2022 - Int32.Parse(this.DateNaissance.Substring(4));
}
}
}