public Patient(string name, int number, int birthday, int birthmonth, int birthyear)
this.birthday = birthday;
this.birthmonth = birthmonth;
this.birthyear = birthyear;
public override int GetHashCode()
return base.GetHashCode();
public override string ToString()
return string.Format("ФИО: {0}\nПолис: {1}\nДата рождения{2}.{3}.{4}", name, number, birthday, birthmonth, birthyear);
public override bool Equals(Object obj)
Patient patient = (Patient)obj;
if (patient.name == this.name && patient.number == this.number && patient.birthday == this.birthday && patient.birthmonth == this.birthmonth&& patient.birthyear == this.birthyear)
public abstract string Name{ get; set;}
public abstract double Square();
public abstract double Perimeter();
public abstract void Print();
public double side {get; set;}
public override double Square()
public override double Perimeter()
public override void Print()
Console.WriteLine("Название фигуры: {Name()}\n" +"Площадь: {Square()}\n" +"Периметр: {Perimeter()}" );
public override string Name
public static void Main()
Patient patient1 = new Patient("Лев", 22022012, 13, 08, 1999);
Patient patient2 = new Patient("Прав", 20203321, 21, 10, 2000);
Console.WriteLine(patient1.ToString());
Console.WriteLine(patient1.Equals(patient2));
Console.WriteLine(patient2);
Quadrat quadrat = new Quadrat();
quadrat.Name = "КВАДРАТИК";