37 lines
947 B
C#
37 lines
947 B
C#
|
namespace Programmation_objet_TLESIO21.TD3.fleuriste {
|
||
|
|
||
|
|
||
|
public class Bouquet {
|
||
|
private LotFleur lot0;
|
||
|
private LotFleur lot1;
|
||
|
private LotFleur lot2;
|
||
|
|
||
|
public Bouquet(LotFleur un, LotFleur deux, LotFleur trois) {
|
||
|
this.lot0 = un;
|
||
|
this.lot1 = deux;
|
||
|
this.lot2 = trois;
|
||
|
}
|
||
|
|
||
|
public double Prix() {
|
||
|
return (lot0.GetPrix() + lot1.GetPrix() + lot2.GetPrix());
|
||
|
}
|
||
|
|
||
|
public LotFleur GetLot0() {
|
||
|
return this.lot0;
|
||
|
}
|
||
|
|
||
|
public LotFleur GetLot1() {
|
||
|
return this.lot1;
|
||
|
}
|
||
|
|
||
|
public LotFleur GetLot2() {
|
||
|
return this.lot2;
|
||
|
}
|
||
|
|
||
|
public override String ToString() {
|
||
|
return "Le bouquet est composé de " + lot0.GetQuantite() + " " + lot0.GetFleur().GetNom() + "s, " + lot1.GetQuantite() + " " + lot1.GetFleur().GetNom() + "s et " + lot2.GetQuantite() + " " + lot2.GetFleur().GetNom() + ". " + lot0.ToString() + " " + lot1.ToString() + " " + lot2.ToString() + ". Le bouquet a donc un prix de " + this.Prix() + "€.";
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|