I am new to C# and struggling through a tutorial printout. My intention is to inherit properties from the class Rectangle. However I am getting an error I cant resolve. any tips appreciated thank you Error C57036 There is no argument given that corresponds to the required formal parameter 'a' of 'Rectangle.Rectangle(double, double)'
{
{
//private static void Main(string[] args)
{
Rectangle myRectangle = new Rectangle(23.5, 8.6);
Console.WriteLine(myRectangle.getArea().ToString());
Console.WriteLine(myRectangle.getParimeter().ToString());
Square mySquare = new Square(15);
Console.WriteLine(mySquare.getArea().ToString());
Console.WriteLine(mySquare.getParimeter().ToString());
Console.ReadLine();
}
}
class Rectangle
{
private double length;
private double width;
public Rectangle(double a, double b)
{
length = a;
width = b;
}
public double getArea()
{
return this.length * this.width;
}
public double getParimeter()
{
return 2 * (this.length + this.width);
}
}
class Square : Rectangle
{
public Square(double a)
{
length = a;
}
}
}