static void Main() { GSM gsm = new GSM("Lumia", "Nokia"); gsm.AddCalls(DateTime.Now, "0889976484", 45); gsm.AddCalls(DateTime.UtcNow, "088956454", 23); gsm.AddCalls(DateTime.Now.AddHours(13), "0883076494", 5); for (int i = 0; i < gsm.CallHistory.Count; i++) { Console.Write("{0}, {1}, {2}", gsm.CallHistory[i].DateAndTime, gsm.CallHistory[i].DialedPhoneNumber, gsm.CallHistory[i].Duration); Console.WriteLine(); } Console.WriteLine(); gsm.DeleteCalls("0883076494"); for (int i = 0; i < gsm.CallHistory.Count; i++) { Console.Write("{0}, {1}, {2}", gsm.CallHistory[i].DateAndTime, gsm.CallHistory[i].DialedPhoneNumber, gsm.CallHistory[i].Duration); Console.WriteLine(); } gsm.ClearHistory(); Console.WriteLine(); for (int i = 0; i < gsm.CallHistory.Count; i++) { Console.Write("{0}, {1}, {2}", gsm.CallHistory[i].DateAndTime, gsm.CallHistory[i].DialedPhoneNumber, gsm.CallHistory[i].Duration); Console.WriteLine(); } }
static void Main() { GSM gsm = new GSM("Lumia", "Nokia"); gsm.AddCalls(DateTime.Now, "0889976484", 45); gsm.AddCalls(DateTime.UtcNow, "088956454", 23); gsm.AddCalls(DateTime.Now.AddHours(13), "0883076494", 5); for (int i = 0; i < gsm.CallHistory.Count; i++) { Console.Write("{0}, {1}, {2}",gsm.CallHistory[i].DateAndTime, gsm.CallHistory[i].DialedPhoneNumber,gsm.CallHistory[i].Duration); Console.WriteLine(); } Console.WriteLine(); gsm.DeleteCalls("0883076494"); for (int i = 0; i < gsm.CallHistory.Count; i++) { Console.Write("{0}, {1}, {2}", gsm.CallHistory[i].DateAndTime, gsm.CallHistory[i].DialedPhoneNumber, gsm.CallHistory[i].Duration); Console.WriteLine(); } gsm.ClearHistory(); Console.WriteLine(); for (int i = 0; i < gsm.CallHistory.Count; i++) { Console.Write("{0}, {1}, {2}", gsm.CallHistory[i].DateAndTime, gsm.CallHistory[i].DialedPhoneNumber, gsm.CallHistory[i].Duration); Console.WriteLine(); } }
static void Test() { GSM[] gsmArr = new GSM[3] { new GSM("Lumia ", " Nokia ", 850, " Pesho"), new GSM("Lumia925 ", " Nokia ", 450, " Gosho"), new GSM("3310 ", " Nokia ", 50, " Ivan"), }; foreach (GSM item in gsmArr) { Console.WriteLine(item.ToString()); } Console.WriteLine(); Console.WriteLine("Apple phone: "); Console.WriteLine(GSM.IPhone4S); }
static GSM() { iPhone = new GSM("iPhone 4S", "Apple", 1000, "Will Smith", new Battery("Apple", 12, 36, BatteryType.LiIon), new Display(7, 16000000)); }