public static void Main() { var phone = new Smartphone(); Console.ReadLine(). Split(' ', StringSplitOptions.RemoveEmptyEntries). ToList(). ForEach(num => phone.Call(num)); Console.ReadLine(). Split(' ', StringSplitOptions.RemoveEmptyEntries). ToList(). ForEach(site => phone.Browse(site)); }
static void Main(string[] args) { Smartphone smartphone = new Smartphone(); ICaller caller = smartphone; string[] phoneNumbers = Console.ReadLine().Split(); caller.Call(phoneNumbers); IBrowser browser = smartphone; string[] urls = Console.ReadLine().Split(); browser.Browse(urls); }
public static void Main(string[] args) { string[] phoneNumbers = Console.ReadLine().Split(" "); string[] sites = Console.ReadLine().Split(" "); Smartphone smartphone = new Smartphone(); foreach (var item in phoneNumbers) { Console.WriteLine(smartphone.Call(item)); } foreach (var item in sites) { Console.WriteLine(smartphone.Browse(item)); } }
static void Main(string[] args) { var numbers = Console.ReadLine().Split(); var url = Console.ReadLine().Split(); var smatrphone = new Smartphone(); foreach (var number in numbers) { Console.WriteLine(smatrphone.Call(number)); } foreach (var s in url) { Console.WriteLine(smatrphone.Browsing(s)); } }
static void Main(string[] args) { var phoneNumInput = Console.ReadLine().Split(); var URLInput = Console.ReadLine().Split(); Smartphone smartphone = new Smartphone(); for (int i = 0; i < phoneNumInput.Length; i++) { smartphone.Calling(phoneNumInput[i]); } for (int i = 0; i < URLInput.Length; i++) { smartphone.Browse(URLInput[i]); } }
static void Main(string[] args) { string[] numbers = Console.ReadLine().Split(' '); string[] links = Console.ReadLine().Split(' '); var smFone = new Smartphone(); for (int i = 0; i < numbers.Length; i++) { Console.WriteLine(smFone.Call(numbers[i])); } foreach (var url in links) { Console.WriteLine(smFone.Browse(url)); } }
static void Main(string[] args) { string[] phoneNumber = Console.ReadLine() .Split(' ') .ToArray(); string[] sites = Console.ReadLine() .Split(' ') .ToArray(); Smartphone smartPhone = new Smartphone(); StationaryPhone stattionaryPhone = new StationaryPhone(); NumberCaller(smartPhone, stattionaryPhone, phoneNumber); Browser(smartPhone, sites); }
static void Main(string[] args) { List <string> numbers = Console.ReadLine() .Split() .ToList(); List <string> sites = Console.ReadLine() .Split() .ToList(); Smartphone phone = new Smartphone(numbers, sites); phone.Call(); phone.Browse(); }
static void Main(string[] args) { string[] inputNumbers = Console.ReadLine().Split(" "); Smartphone smartphone = new Smartphone(); for (int i = 0; i < inputNumbers.Length; i++) { Console.WriteLine(smartphone.Call(inputNumbers[i])); } string[] inputWebsites = Console.ReadLine().Split(); for (int i = 0; i < inputWebsites.Length; i++) { Console.WriteLine(smartphone.Browse(inputWebsites[i])); } }
static void Main(string[] args) { var numbers = Console.ReadLine().Split(' '); var sites = Console.ReadLine().Split(' '); Smartphone smartphone = new Smartphone(); foreach (var num in numbers) { Console.WriteLine(smartphone.CallPhonenumber(num)); } foreach (var site in sites) { Console.WriteLine(smartphone.Browse(site)); } }
static void Main(string[] args) { Smartphone smartphone = new Smartphone(); string[] phones = Console.ReadLine().Split(); foreach (var phone in phones) { Console.WriteLine(smartphone.Call(phone)); } string[] urls = Console.ReadLine().Split(); foreach (var url in urls) { Console.WriteLine(smartphone.Browse(url)); } }
static void Main(string[] args) { string[] phoneNumbers = Console.ReadLine().Split(); string[] sites = Console.ReadLine().Split(); Smartphone sp = new Smartphone(); foreach (string number in phoneNumbers) { Console.WriteLine(sp.Calling(number)); } foreach (string site in sites) { Console.WriteLine(sp.Browsing(site)); } }
public static void Main() { string[] numbers = Console.ReadLine().Split(); string[] sites = Console.ReadLine().Split(); Smartphone smartphone = new Smartphone(); foreach (var number in numbers) { Console.WriteLine(smartphone.Calling(number)); } foreach (var site in sites) { Console.WriteLine(smartphone.Browsing(site)); } }
public static void Main() { Smartphone phone = new Smartphone(); string[] phoneNumbers = Console.ReadLine().Split(" "); string[] webSites = Console.ReadLine().Split(" "); for (int i = 0; i < phoneNumbers.Length; i++) { Console.WriteLine(phone.Call(phoneNumbers[i])); } for (int i = 0; i < webSites.Length; i++) { Console.WriteLine(phone.Browse(webSites[i])); } }
static void Main(string[] args) { var phoneNumbers = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries); var webSites = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries); var smartphone = new Smartphone(); foreach (var number in phoneNumbers) { smartphone.Call(number); } foreach (var website in webSites) { smartphone.Browse(website); } }
static void Main(string[] args) { var tele = new Smartphone(); string[] numbers = Console.ReadLine().Split(); string[] urls = Console.ReadLine().Split(); foreach (var number in numbers) { Console.WriteLine(tele.Call(number)); } foreach (var url in urls) { Console.WriteLine(tele.Browse(url)); } }
static void Main(string[] args) { var numbers = Console.ReadLine().Split().ToArray(); var webSites = Console.ReadLine().Split().ToArray(); ISmartphone smartphone = new Smartphone(); IStationaryPhone stationaryPhone = new StationaryPhone(); for (int i = 0; i < numbers.Length; i++) { try { if (numbers[i].Length == 10) { smartphone.Call(numbers[i]); } else if (numbers[i].Length == 7) { stationaryPhone.Dialing(numbers[i]); } } catch (ArgumentException ae) { Console.WriteLine(ae.Message); } } for (int i = 0; i < webSites.Length; i++) { try { smartphone.Browse(webSites[i]); } catch (ArgumentException ae) { Console.WriteLine(ae.Message); } } if (webSites.Length == 0) { Console.WriteLine("Invalid URL!"); } }
public static void Main(string[] args) { string[] numbers = Console.ReadLine() .Split(" ") .ToArray(); string[] urls = Console.ReadLine() .Split(" ") .ToArray(); foreach (var number in numbers) { try { if (number.Length == 7) { StationatyPhone stationatyPhone = new StationatyPhone(); Console.WriteLine(stationatyPhone.Call(number)); } else if (number.Length == 10) { Smartphone smartphone = new Smartphone(); Console.WriteLine(smartphone.Call(number)); } else { throw new InvalidCallNumber(); } } catch (InvalidCallNumber iue) { Console.WriteLine(iue.Message); } } foreach (var url in urls) { try { Smartphone smartphone = new Smartphone(); Console.WriteLine(smartphone.Browse(url)); } catch (InvalidUrlException iue) { Console.WriteLine(iue.Message); } } }
static void Main(string[] args) { string[] numbersToCall = Console.ReadLine().Split(); string[] sites = Console.ReadLine().Split(); Smartphone smartphone = new Smartphone(); foreach (var item in numbersToCall) { bool isValid = true; foreach (var digit in item) { if (!char.IsDigit(digit)) { isValid = false; } } if (isValid) { Console.WriteLine($"{smartphone.Call()}{item}"); } else { Console.WriteLine("Invalid number!"); } } foreach (var item in sites) { bool isValid = true; foreach (var letter in item) { if (char.IsDigit(letter)) { isValid = false; } } if (isValid) { Console.WriteLine($"{smartphone.Browse()}{item}!"); } else { Console.WriteLine("Invalid URL!"); } } }
static void Main() { var phone = new Smartphone(); var numbers = Console.ReadLine().Split(); var urls = Console.ReadLine().Split(); foreach (var number in numbers) { phone.Call(number); } foreach (var url in urls) { phone.Browse(url); } }
private static void PrintNumbers(string[] phoneNumbers) { foreach (var phoneNumber in phoneNumbers) { try { Smartphone smartPhone = new Smartphone { Number = phoneNumber }; Console.WriteLine(smartPhone.CallNumber()); } catch (ArgumentException message) { Console.WriteLine(message.Message); } } }
public static void Main() { Smartphone smartphone = new Smartphone(); string[] phoneNumbers = Console.ReadLine().Split(); string[] urls = Console.ReadLine().Split(); foreach (string number in phoneNumbers) { Console.WriteLine(smartphone.Call(number)); } foreach (string url in urls) { Console.WriteLine(smartphone.Browse(url)); } }
public static void Main(string[] args) { Smartphone smartphone = new Smartphone(); string[] inputNumbers = Console.ReadLine().Split(); string[] inputUrls = Console.ReadLine().Split(); for (int i = 0; i < inputNumbers.Length; i++) { smartphone.Call(inputNumbers[i]); } for (int i = 0; i < inputUrls.Length; i++) { smartphone.Browse(inputUrls[i]); } }
public static void Main(string[] args) { string[] numbersToCall = Console.ReadLine().Split(); string[] websitesToBrowse = Console.ReadLine().Split(); Smartphone smartPhone = new Smartphone(); for (int i = 0; i < numbersToCall.Length; i++) { Console.WriteLine(smartPhone.Call(numbersToCall[i])); } for (int i = 0; i < websitesToBrowse.Length; i++) { Console.WriteLine(smartPhone.Browse(websitesToBrowse[i])); } }
static void Main(string[] args) { ISmartphonable smartphone = new Smartphone(); IStationaryPhonable stacionary = new Stacionary(); string[] inputNumbers = Console.ReadLine().Split(); string pattern = @"(\b\d{10}\b)|(\b\d{7}\b)"; Regex phoneNumbers = new Regex(pattern); foreach (var item in inputNumbers) { if (phoneNumbers.IsMatch(item)) { if (item.Length == 7) { stacionary.Dialing(item.ToString()); } else { smartphone.Calling(item.ToString()); } } else { Console.WriteLine("Invalid number!"); } } string[] inputSites = Console.ReadLine().Split(); string patternSites = @"(\b[a-zA-Z]+:\/\/[a-zA-Z]+\.[a-zA-Z]+\.[a-zA-Z]+\b)|(\b[a-zA-Z]+\.[a-zA-Z]+\.[a-zA-Z]+\b)|(\b[a-zA-Z]+:\/\/[a-zA-Z]+\.[a-zA-Z]+\b)|(\b[a-zA-Z]+\.[a-zA-Z]+\b)"; Regex sites = new Regex(patternSites); foreach (var item in inputSites) { if (sites.IsMatch(item)) { smartphone.Browsing(item.ToString()); } else { Console.WriteLine("Invalid URL!"); } } }
static void Main(string[] args) { string[] phoneNumbers = Console.ReadLine().Split(); string[] urls = Console.ReadLine().Split(); Smartphone phone = new Smartphone(); foreach (var phoneNumber in phoneNumbers) { Console.WriteLine(phone.CallPhoneNumber(phoneNumber)); } foreach (var url in urls) { Console.WriteLine(phone.BrowsePage(url)); } }
public static void Main(string[] args) { string[] numbers = Console.ReadLine().Split(new [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); string[] urls = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); Smartphone smartphone = new Smartphone(); foreach (var number in numbers) { Console.WriteLine(smartphone.Call(number)); } foreach (var url in urls) { Console.WriteLine(smartphone.Browse(url)); } }
static void Main(string[] args) { var numbers = Console.ReadLine().Split(); var urls = Console.ReadLine().Split(); foreach (var number in numbers) { ICallable smartphone = new Smartphone(); Console.WriteLine(smartphone.Call(number)); } foreach (var url in urls) { IBrowsable smartphone = new Smartphone(); Console.WriteLine(smartphone.Browse(url)); } }
static void Main(string[] args) { string[] telephoneNumbers = Console.ReadLine().Split(" "); string[] urlAdreses = Console.ReadLine().Split(" "); Smartphone smartphone = new Smartphone(); foreach (string number in telephoneNumbers) { Console.WriteLine(smartphone.Call(number)); } foreach (string url in urlAdreses) { Console.WriteLine(smartphone.Browse(url)); } }
public static void Main(string[] args) { var numbers = Console.ReadLine().Split(); var sites = Console.ReadLine().Split(); Smartphone phone = new Smartphone(); foreach (var number in numbers) { Console.WriteLine(phone.Call(number)); } foreach (var site in sites) { Console.WriteLine(phone.Browse(site)); } }