40 lines
955 B
C#
40 lines
955 B
C#
|
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() + "€.";
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|