ah, just use the Fundamental Theorem of Calculus to find the definite integral Anyway, this kinda reaks of homework...I'll help a bit anyway.
you either have an equation, f(x), or a set of data. Either works. If you have f(x), then you will want to determine what increments you are going to use for delta X (change in x/height of the trapezoid), determine the range that you are using, and then use a for loop to determine the value for f(x) at each value of x. If you already have the data, you can just skip that part. (it looks like you already have it)
Now, the area of a trapezoid is given by the formula .5(b1+b2)*h, and in this case, the h is equal to delta X, your increment. B1 is equal to the value of f(x) at the left hand side of your trap, B2 is equal to the value of f(x) at the right hand side of the trap. Delta X is going to stay constant, so .5(h) is going to be a constant, multiplied by (b1+b2). (If you don't understand that, you shouldn't be doing calc without knowing the distributive property )
So...calculate .5h. Then loop through your values for f(x) kinda like this...
Code:
float totalarea=0;
for(float x=lowerendofrange; x<(upperendofrange-increment);x+increment)
{
b1=f(x);
b2=f(x+increment);
totalarea+=.5*increment*(b1+b2);
}
cout<<"The area under the curve is:"<<area;
That isn't the complete program. You need to do a little bit of work with that, but it should be easy.
oh...and one more thing... USE CODE TAGS!