Exercise: Simpson's Rule

Simpson's composite rule states that the integral of F(x) between a and b can be approximated thus:

where h = (b - a) / n. You must write a program to prompt the user for a, b and the number of intervals to use. It should then calculate values of x and F(x) and use Simpson's rule to approximate the area under the curve between the start and end points.

Use a module to hold the function F(x) to evaluate. Use F(x) = sin(x)/x.

Solutions: Fortran.