public static void Main(string[] args) { Calls call = new Calls(); call.StartNewCall("0893 655 921", Direction.Outgo); SimulateCallDelay(2000); // Simulate call delay call.EndCall(State.Answered); call.StartNewCall("0893 111 111", Direction.Outgo); SimulateCallDelay(1100); // Simulate call delay call.EndCall(State.Rejected); call.StartNewCall("0893 222 222", Direction.Outgo); SimulateCallDelay(4567); // Simulate call delay call.EndCall(State.Answered); call.StartNewCall("0893 333 333", Direction.Outgo); SimulateCallDelay(); // Simulate call delay call.EndCall(State.Missed); /* * First task */ Console.WriteLine("{0}", new string('-', 20)); // Get all cals information for (int i = 0; i < call.HistoryCount; i++) { string callInfo = call.GetHistory(i); Console.WriteLine(callInfo); } /**** * Second task */ Console.WriteLine("{0}", new string('-', 20)); // Get total call costs in curretn curency [BGN] decimal totalCallsPrice = call.GetCallsTotalPrice(); Console.WriteLine("Total calls price: {0:F2} lv.", totalCallsPrice); /**** * Third task */ Console.WriteLine("{0}", new string('-', 20)); // Delete the longest call from the history list int longestCallIx = call.FindLongestCall(); call.RemoveSingleCall(longestCallIx); Console.WriteLine("Delete the longest call from the history list"); for (int i = 0; i < call.HistoryCount; i++) { string callInfo = call.GetHistory(i); Console.WriteLine(callInfo); } Console.WriteLine("Total calls price: {0:F2} lv.", call.GetCallsTotalPrice()); /**** * Forth task */ Console.WriteLine("{0}", new string('-', 20)); // Delete all calls from the history list call.RemoveAllCalls(); Console.WriteLine("Delete all calls from the history list"); for (int i = 0; i < call.HistoryCount; i++) { string callInfo = call.GetHistory(i); Console.WriteLine(callInfo); } }