private static void BrowseWeb(string[] webSites, Smartphone phone)
 {
     foreach (var site in webSites)
     {
         try
         {
             Console.WriteLine(phone.Browse(site));
         }
         catch (ArgumentException ex)
         {
             Console.WriteLine(ex.Message);
         }
     }
 }
 private static void CallPhones(string[] phoneNumbers, Smartphone phone)
 {
     foreach (var number in phoneNumbers)
     {
         try
         {
             Console.WriteLine(phone.Call(number));
         }
         catch (ArgumentException ex)
         {
             Console.WriteLine(ex.Message);
         }
     }
 }
Example #3
0
        static void Main(string[] args)
        {
            var phone        = new Smartphone();
            var phoneNumbers = Console.ReadLine().Split();
            var sites        = Console.ReadLine().Split();

            if (phoneNumbers.Length > 0)
            {
                phone.Call(phoneNumbers);
            }

            if (sites.Length > 0)
            {
                phone.Browse(sites);
            }
        }