area method

  1. @override
double area()
override

Calculates the area of the Trapezoid.

Formula: A = (h / 2) * (a + b) Returns the area as a double.

Implementation

@override
double area() {
  return (height / 2) * (base1 + base2);
}