using System;
namespace Projects
{
class Worker
{
public string name;
public int Age{
get => Age;
set
{
if(Age > value)
{
Console.WriteLine("Error");
}
else
{
Age = value;
}
}
}
public int ID {get;set;}
public int Pay {get;set;}
public Worker(){}
public Worker(string name,int Age,int ID,int Pay){
this.name = name;
this.Age = Age;
this.ID = ID;
this.Pay = Pay;
}
public void About()
{
Console.WriteLine("{0},{1},{2},{3}",name,Age,ID,Pay);
}
}
}
using System;
namespace Projects
{
class Program
{
static void Main(string[] args)
{
Worker Thomas = new Worker("Thomas",24,0467,30000);
Thomas.About();
Console.ReadLine();
}
}
}