24 lines
509 B
C#
24 lines
509 B
C#
namespace OOP.Figures
|
|
{
|
|
public class Rectangle : Shape
|
|
{
|
|
public Rectangle(double width, double height)
|
|
{
|
|
this.height = height;
|
|
this.width = width;
|
|
}
|
|
|
|
public double height { get; set; }
|
|
public double width { get; set; }
|
|
|
|
public override double GetArea()
|
|
{
|
|
return height * width;
|
|
}
|
|
|
|
public override double GetPerimeter()
|
|
{
|
|
return (height * 2) + (width * 2);
|
|
}
|
|
}
|
|
} |