fin TD3
This commit is contained in:
40
TD3/fleuriste/LotFleur.cs
Normal file
40
TD3/fleuriste/LotFleur.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
namespace Programmation_objet_TLESIO21.TD3.fleuriste {
|
||||
|
||||
|
||||
public class LotFleur {
|
||||
|
||||
private int quantite;
|
||||
private Fleur Fleur;
|
||||
|
||||
public LotFleur(Fleur nomFleur, int quantiteFleur) {
|
||||
this.quantite = quantiteFleur;
|
||||
this.Fleur = nomFleur;
|
||||
}
|
||||
|
||||
public int GetQuantite() {
|
||||
return quantite;
|
||||
}
|
||||
|
||||
public Fleur GetFleur() {
|
||||
return Fleur;
|
||||
}
|
||||
|
||||
public double GetPrix() {
|
||||
return this.GetFleur().GetPrix() * this.GetQuantite();
|
||||
}
|
||||
|
||||
public void SetQuantite(int quantite) {
|
||||
this.quantite = quantite;
|
||||
}
|
||||
|
||||
public void SetFleur(Fleur fleur) {
|
||||
Fleur = fleur;
|
||||
}
|
||||
|
||||
public override String ToString() {
|
||||
return this.GetFleur().ToString() + " Le lot de " + this.GetQuantite() + " " + this.GetFleur().GetNom() + "s coute donc " + this.GetPrix() + "€.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user