Esempio n. 1
0
        static void Main(string[] args)
        {
            CoffeePowder  coffe      = new CoffeePowder(100);
            GalonAir      water      = new GalonAir(1000);
            Milk          milk       = new Milk(300);
            CoffeeMachine yummyCoffe = new CoffeeMachine(coffe, water, milk);

            //1st cup coffe
            Console.WriteLine("check " + yummyCoffe.checkAvailability());
            String result = yummyCoffe.makeCappucino();

            Console.WriteLine("result " + result);

            //2nd cup coffe
            Console.WriteLine("check " + yummyCoffe.checkAvailability());
            result = yummyCoffe.makeEsspresso();
            Console.WriteLine("result " + result);

            //3nd cup coffe
            Console.WriteLine("check " + yummyCoffe.checkAvailability());
            result = yummyCoffe.makeEsspresso();
            Console.WriteLine("result " + result);

            //4nd cup coffe
            Console.WriteLine("check " + yummyCoffe.checkAvailability());
            result = yummyCoffe.makeCappucino();
            Console.WriteLine("result " + result);

            //5nd cup coffe
            Console.WriteLine("check " + yummyCoffe.checkAvailability());
            result = yummyCoffe.makeCappucino();
            Console.WriteLine("result " + result);

            //6nd cup coffe
            Console.WriteLine("check " + yummyCoffe.checkAvailability());

            result = yummyCoffe.makeEsspresso();
            Console.WriteLine("result " + result);

            Console.WriteLine("check " + yummyCoffe.checkAvailability());
        }
Esempio n. 2
0
 public CoffeeMachine(CoffeePowder powder, GalonAir galon, Milk milk)
 {
     this.waterGalon  = galon;
     this.coffePowder = powder;
     this.Milk        = milk;
 }