private static void DisplayCallHistory(GSM myGSM) { StringBuilder sb = new StringBuilder(); Console.WriteLine("{0,25}{1,25}{2,20}", "Begin of call", "Dialed Phone Number", "Call Duration /s/"); Console.WriteLine(new string('_', 70)); foreach (Call call in myGSM.CallHistory) { sb.Append(call.ToString() + '\n'); } Console.WriteLine(sb); Console.WriteLine(new string('_', 70)); Console.WriteLine( "{0,25}{1,25}{2,16} min", "Total duration of calls: ", string.Empty, myGSM.CalculateCallsDuration()); Console.WriteLine( "{0,25}{1,25}{2,20:C}", "Total price of calls: ", string.Empty, myGSM.CalculateTotalPriceOfCalls(0.37m)); }