static void Main(string[] args) { GSM firstGSM = new GSM(); firstGSM.Model = "Nokia"; firstGSM.Manufacturer = "Germany"; firstGSM.Price = 105.95M; firstGSM.Owner = "Peter"; GSM secondGSM = new GSM(); Console.WriteLine("\"{0}\" this is first model made in {2}, price - {3:C}, Owner - {4} \nand this \"{1}\" is second model.", firstGSM.Model, secondGSM.Model, firstGSM.Manufacturer, firstGSM.Price,firstGSM.Owner); Battery test = new Battery("NiCd", 14, 12); Console.WriteLine(test.ModelBattery + " - " + test.HoursIDLE + " - " + test.HoursTalk); GSM prob = new GSM(); prob.DisplayPr.Size = 12; prob.DisplayPr.NumberColor = 32; prob.BatteryPr.HoursTalk = 10; Console.WriteLine("size - {0}, number of color(s) - {1}", prob.DisplayPr.Size, prob.DisplayPr.NumberColor); Console.WriteLine("Talk time {0}", prob.BatteryPr.HoursTalk); }
//, Display display // constructor public GSM(string model, string manufacturer, decimal price, string owner, Battery battery) { this.Model = model; this.Manufacturer = manufacturer; //if (price <= 0) // Console.WriteLine("It is Not correct price."); this.Price = price; this.Owner = owner; //this.DisplayPr = display; // ? can do this without this settings ? how ? what is differences ? this.BatteryPr = battery; }