Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
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.