Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace Telephony
- {
- public class Smartphone : ICallable, IBrowsable
- {
- public string CallOtherPhone(string Number)
- {
- if (!Number.All(ch => char.IsDigit(ch)))
- {
- throw new ArgumentException("Invalid number!");
- }
- return $"Calling... {Number}";
- }
- public string BrowseInWeb(string URL)
- {
- if (URL.Any(ch => char.IsDigit(ch)))
- {
- throw new ArgumentException("Invalid URL!");
- }
- return $"Browsing: {URL}";
- }
- }
- }
Add Comment
Please, Sign In to add comment