24 lines
499 B
C#
24 lines
499 B
C#
namespace OOP.Figures
|
|
{
|
|
public class Rectangle : Shape
|
|
{
|
|
public Rectangle(double width, double height)
|
|
{
|
|
Height = height;
|
|
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);
|
|
}
|
|
}
|
|
} |