I am having trouble with part of my java project I have to do during the summer.I was able to complete one of the assignments, but not the second one. I was wondering if any of you could help me with the following assignment:
A trapezoid is a geometric shape that has four sides. Two of these are parallel and are called the bases of the trapezoid. The height is the distance between the bases. Define a Trapezoid class that encapsulates the height and the length of each base. Provide a constructor that initializes these instance variables. Provide one instance method that calculates the area of the shape. The area equals 0.5 *height *(base1+base2). Instantiate an object of this class and invoke its method.