Exemple #1
0
        static void Main(string[] args)
        {
            FruitSeller seller0 = new FruitSeller("손오공", 0, 30, 1500);
            FruitSeller seller1 = new FruitSeller("저팔계", 0, 20, 2000);
            FruitBuyer  buyer   = new FruitBuyer("홍길동", 10000);

            buyer.buyApple(seller0, 3000);
            buyer.buyApple(seller1, 4000);

            buyer.showBuyResult();
            seller0.showSaleResult();
            seller1.showSaleResult();
        }
Exemple #2
0
 public void buyApple(FruitSeller seller, int money)
 {
     this.numOfApple += seller.saleApple(money);
     this.myMoney    -= money;
 }