| namespace module12;
|
|
|
| class Rectangle : TwoDFigure
|
| {
|
| protected double Width;
|
| protected double Length;
|
|
|
| public Rectangle(double width, double length)
|
| {
|
| this.Width = width;
|
| this.Length = length;
|
|
|
| this.Perimeter = 2 * (length + width);
|
| this.Area = length * width;
|
| }
|
|
|
| public new string Display()
|
| {
|
| return $"Shape = {this.Shape} / Width = {this.Width} / Length = {this.Length} / Perimeter = {this.Perimeter} / Area = {this.Area}";
|
| }
|
| }
|