The instructions are:

You will write a program that evaluates the integral of sin(x) using the left-hand rectangle rule with

2000 subintervals, over 10 intervals. The intervals to test are [0, 1), [1, 2), …, [8, 9), [9, 10). You will

declare an array of type double that can hold 10 elements, and you will use this array to hold all 10

results you get from evaluating each interval.

Once you have calculated the integral as described for each interval, and the results are all stored in

your array, you will sort the array from smallest to largest, and output each element on separate lines.

// I think I did something incorrect. Can you please check my code, and tell me what I did wrong? Thank you.Code:#include <iostream> #include <cmath> using namespace std; double integrate(double a, double b, int n); double f(double x); int main() { const int Array_Size = 10; int numbers[Array_Size]; int count; for(count=0; count<10; count++) cout << f(numbers[count]) << endl; } double integrate(double x1, double x2, int n) { double sum = 0, delta_x = (x2-x1) / n; for (int i=0; i<n; ++i) { sum+=f(x1+i*delta_x); } return sum * delta_x; } double f(double x) { return sin(x); }