не найдено подходящего метода для переопределения c #
Я попробовал несколько вещей, чтобы исправить ошибку, и я просто не могу понять это, я был бы очень признателен за любую помощь. Ошибка присутствует как в классах Triangle, так и в Square, ошибки в Triangle «не реализуют унаследованный абстрактный член из GeometricFigure» и «не найден подходящий метод для переопределения», а в Square есть только «не найден подходящий метод для переопределения».
namespace ShapesDemo
{
class Program
{
static void Main(string[] args)
{
Rectangle rec = new Rectangle(8,10);
Square squ = new Square(11, 12);
Triangle tri = new Triangle(10, 20);
Console.WriteLine("Computed area is {0}" + "\n\n" + "Computed Triangle is: {1}" + "\n", squ.ComputeArea(rec.Area), tri.ComputeArea(rec.Area));
}
}
abstract class GeometricFigure
{
public decimal _height, _width, _area;
public decimal Height
{
get { return _height; }
set { _height = value; }
}
public decimal Width
{
get { return _width; }
set { _width = value; }
}
public decimal Area
{
get { return _area; }
}
public abstract decimal ComputeArea();
}
class Rectangle : GeometricFigure
{
private decimal height, width;
public Rectangle(decimal sideA, decimal sideB)
{
this.height = sideA;
this.width = sideB;
}
public Rectangle()
{
}
public override decimal ComputeArea()
{
Console.WriteLine("The Area is" + _width.ToString(), _height.ToString());
return width * height;
}
}
class Square : Rectangle
{
public Square(decimal sideA, decimal sideB)
{
this._width = sideA;
this._height = sideB;
if (sideA != sideB)
this._height = this._width;
}
public Square(decimal xy)
{
this._width = xy;
this._height = this._width;
}
public override decimal ComputeArea(decimal _area)
{ return _area = this._width * this._height; }
}
class Triangle : GeometricFigure
{
public Triangle(int x, int y)
{
this.Width = x;
this.Height = y;
}
public override decimal ComputeArea(decimal _area)
{ return _area = (this.Width * this.Height) / 2; }
}
}