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(); }
public Goods(double price, string name, GoodsGroup group) { this.name = name; this.price = price; this.goodsGroup = group; }
public BadGoods(double price, string name, GoodsGroup group, string reason, double newPrice) : base(price, name, group) { Reason = reason; NewPrice = newPrice; }
public Goods() { price = 0; name = "unspecified"; goodsGroup = new GoodsGroup(); }