static void Main() { GSM nokia = new GSM(); nokia.AddCall(new Call(252)); Call pesho = new Call((180)); nokia.AddCall(pesho); nokia.CallInfo(new Call(252)); nokia.CallInfo(pesho); string price = nokia.CalcTotalPrice(0.37); Console.WriteLine(price); nokia.RemoveLongestCall(); price = nokia.CalcTotalPrice(0.37); Console.WriteLine(price); nokia.RemoveAllCalls(); price = nokia.CalcTotalPrice(0.37); Console.WriteLine(price); }
public void CallInfo(Call call) { Console.WriteLine("Date : {0}", call.Date); Console.WriteLine("Start time : {0}", call.Time); Console.WriteLine("DialedPhoneNum : {0}", call.DialedPhoneNum); Console.WriteLine("Duration : {0}", call.Duration); Console.WriteLine(new string('-', 40)); Console.WriteLine(); }
public void RemoveCall(Call call) { this.callHistory.Remove(call); }
public void AddCall(Call call) { this.callHistory.Add(call); }