private string firstName;
public Person(string a, string b, int c)
if (string.IsNullOrEmpty(value))
throw new ArgumentNullException("value", "The firstname cannot be null or empty!");
if (string.IsNullOrEmpty(value))
throw new ArgumentNullException("value", "The last name cannot be null or empty!");
if (value < 10 || value > 120)
throw new ArgumentOutOfRangeException("value", "Age should be in htis range 0-120!");
public static void Main()
Console.WriteLine("Пример за контрол на входните данни");
Person gosho = new Person("Георги", "Яворов", 25);
Person ivan = new Person("Марин", "Петров", 125);
Person tosho = new Person("Драган", "Георгиев", 55);
Console.WriteLine(gosho.FirstName + " " + gosho.LastName + " " + gosho.Age);
Console.WriteLine(ivan.FirstName + " " + ivan.LastName + " " + ivan.Age);
Console.WriteLine(tosho.FirstName + " " + tosho.LastName + " " + tosho.Age);
catch (ArgumentNullException ex)
Console.WriteLine("Exception throw {0}:", ex.Message);
catch (ArgumentOutOfRangeException ex)
Console.WriteLine("Exception throw {0}:", ex.Message);