Exemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = FirstSide.GetHashCode();
         hashCode = (hashCode * 397) ^ SecondSide.GetHashCode();
         hashCode = (hashCode * 397) ^ ThirdSide.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 2
0
 protected bool Equals(ColoredTriangle other)
 {
     return(FirstSide.Equals(other.FirstSide) &&
            SecondSide.Equals(other.SecondSide) &&
            ThirdSide.Equals(other.ThirdSide));
 }
Exemplo n.º 3
0
 public override double Length()
 {
     return(2 * (FirstSide.Length() + SecondSide.Length()));
 }
Exemplo n.º 4
0
 public override string ShowInfo()
 {
     return($"Прямоугольник со сторонами {FirstSide.Length():0.000} и {SecondSide.Length():0.000}, площадью {this.Area():0.000} и радиусом {this.Length():0.000}");
 }
Exemplo n.º 5
0
 public double Area()
 {
     return(FirstSide.Length() * SecondSide.Length());
 }