示例#1
0
        static void Main(string[] args)
        {
            Cart cart = new SupermarketCart();
            Product nike = new Shoes("耐克运动鞋", 102.2m, 41);
            cart.Add(nike);
            cart.Show();

            Cart insuranceCart = new InsuranceCart();
            Product insurance = new Insurance("中国人寿", 1000, DateTime.Now, DateTime.Now.AddDays(300));
            insuranceCart.Add(insurance);
            insuranceCart.Show();

            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Cart    cart = new SupermarketCart();
            Product nike = new Shoes("耐克运动鞋", 102.2m, 41);

            cart.Add(nike);
            cart.Show();

            Cart    insuranceCart = new InsuranceCart();
            Product insurance     = new Insurance("中国人寿", 1000, DateTime.Now, DateTime.Now.AddDays(300));

            insuranceCart.Add(insurance);
            insuranceCart.Show();

            Console.ReadLine();
        }