A trapezoid is a convex quadrilateral with at least one pair of parallel sides as shown in the figure below
The formula to compute the area of a trapezoid:
Get Assignment Writing Help
Our experts are ready to complete your assignment, course work. essay, test, dissertation, research paper, quizGet Started
Write a header fileTrapezoid.h containing the Trapezoidclass definition and the source file Trapezoid.cpp containing the class implementation and the main method.
Your class should include attributes a, b and h as float, a constructor to initialize them and a method computeArea(), of type double, to compute the area of the trapezoid as given in the formula above.
In the main method, prompt the user to enter each attribute a, b and h from the keyboard before passing them to the constructor.
In the attachment, there are two header file definitions for class Car and class Engine, and the Source.cpp which contains the main method.
Complete the header file by including the inclusion guard for both header files and completing the implementation of the public methods in Car.cpp and Engine.cpp
Stuck with a Question?
Get it solved from our top experts within 8 hrs!Ask Your Question Now!