Esempio n. 1
0
        static void Main(string[] args)
        {
            GoodsGroup group         = new GoodsGroup("group1", 100);
            Goods      goodie        = new Goods(372.50, "goodie", group);
            BadGoods   anothergoodie = new BadGoods(350, "badgoodie", group, "broken", 200);

            goodie.Print();

            Console.WriteLine("Price of our goodie: {0}", goodie.Price);
            Console.WriteLine(goodie.ToString());
            Console.ReadLine();
        }
Esempio n. 2
0
 public Goods(double price, string name, GoodsGroup group)
 {
     this.name       = name;
     this.price      = price;
     this.goodsGroup = group;
 }
Esempio n. 3
0
 public BadGoods(double price, string name, GoodsGroup group, string reason, double newPrice) :
     base(price, name, group)
 {
     Reason   = reason;
     NewPrice = newPrice;
 }
Esempio n. 4
0
 public Goods()
 {
     price      = 0;
     name       = "unspecified";
     goodsGroup = new GoodsGroup();
 }