public Date(int day,int month, int year)
public void SetYear(int year)
public void SetMonth(int month)
public void SetDay(int day)
public int CompareTo(Date other)
if (this.year > other.year)
if(this.year < other.year)
if(this.month > other.month)
if(this.month < other.month)
public passport(string name,Date a,int num)
this.a=new Date(a.GetDay(),a.GetMonth(),a.GetYear());
public passport(passport p)
this.a=new Date(p.a.GetDay(),p.a.GetMonth(),p.a.GetYear());
public override String ToString()
return "name: "+this.name+"\nexpiry date: "+this.a+"\nID: "+this.num;
if(this.a.CompareTo(b)>=0)
this.a=new Date(b.GetDay(),b.GetMonth(),b.GetYear());
public traveler(passport a,bool b)
public override string ToString ()
return this.a+"\npay: "+this.b;
public bool check(Date c)
public static void Main()
Date d1=new Date(12,03,2010);
Date d2=new Date(30,01,2002);
Date d3=new Date(30,01,2002);
passport a=new passport("noam",d2,2132322);
traveler c=new traveler(a,false);
Console.WriteLine(c.ToString());