예제 #1
0
        public static void CookVegitable(Vegetable vegitable, Chef chef)
        {
            Potato potato = new Potato();
            bool isCookable = IsCookable(potato);

            if (isCookable)
            {
               chef.Cook(potato);
            }
            else
            {
                throw new ArgumentException("The Vegitable be not rotten and peeled!");
            }
        }
 public static void Main()
 {
     Chef chef = new Chef();
     chef.Cook();
 }