Here is my program that i have made for calculating Area of a Trapezoid :
Code:
#include <iostream>
using namespace std;
int flip (void);
int main()
{
cout<<"Now in the flip function" << endl;
return 1;
{double baseOne, baseTwo, baseSum, completebaseSum, Altitude, Area;
cout<<"What is the length of the first base of the Trapezoid?"<<endl;
cin>> baseOne;
cout<<"What is the length of the second base of the Treapezoid?"<<endl;
cin>> baseTwo;
baseSum = (baseOne + baseTwo);
completebaseSum = (baseSum / 2);
cout<<"What is the altitude of the Trapezoid?"<<endl;
cin>> Altitude;
Area = (Altitude * completebaseSum);
cout<<"The area of the Trapezoid is:"<< Area<< endl;
system("PAUSE");
return 0;
}
Bookmarks