Question: (C++) Implement the pseudocode for the Trapezoid procedure in C++. Test the code on the following functions. In each case, compare the result with the

(C++) Implement the pseudocode for the Trapezoid procedure in C++. Test the code on the following functions. In each case, compare the result with the correct answer.
10 e(-x*x) dx
10 (x2+2 ) dx
10 arctan x dx
10 exdx
Trapezoid Pseudocode program Trapezoid integer i; real h, sum, x integer n = 60; real a = 0, b + 1 h = (b - a) sum [f(a) + f(b)] for i = 1 to n - 1 x + a + ih sum + sum + f(x) end for sum + (sum)h output sum end Trapezoid real function f (x) real x fr + 1/er? end function f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
