public static void Main(string[] args)
Console.Write("Please enter the length of the Rectangle: ");
double l = double.Parse(Console.ReadLine());
Console.Write("Please enter the width of the Rectangle: ");
double w = double.Parse(Console.ReadLine());
Rectangle myRectangle = new Rectangle(l, w);
Console.WriteLine("The area of the Rectangle is " + myRectangle.GetArea());
Console.Write("Now, please input the base of the triangle: ");
double b = double.Parse(Console.ReadLine());
Console.Write("Now, please input the height of the triangle: ");
double h = double.Parse(Console.ReadLine());
Triangle myTri = new Triangle(b , h);
Console.WriteLine("The area of the Trianggle is " + myTri.GetArea());
public abstract double GetArea();
public Rectangle(double l, double w)
public override double GetArea()
double areaRectangle = tlength * twidth;
public Triangle(double r, double h)
public override double GetArea()
double areaTriangle = (tbase * theight)/2;