Trapezoid is a quadrilateral with two parallel sides. The Area of a trapezoid is equal to the average length of the two parallel side multiply by the height.
In this example you will learn how to create an application from a given formula and write a simple program that will accept input or data from the user.
|Recommended to Read First: Defining Variables and Input Output Operations in C++|
The same with the first and second example, create an empty project first, add a cpp file and use any name that you want.
If your a first time user of Visual C++ Express Edition, it is recommended to read the step by step procedure. Read here
cout << "Enter the length of the first parallel side: ";
cout << endl << "Enter the length of the second parallel side: ";
cout << endl << "Enter the height: ";
Area = (parallelsidea + parallelsideb) / 2 * height;
cout << endl << "Area of the Trapezoid: " << Area << endl;
Press F5 to run the program.