Copy and last the code , that why I dont have to write it again.
Question: Develop a program that employs "Simpson's Rule" to numerically integrate aselected function f(x) over a specified one-dimensional range a..b. The user chooses at runtime one of 3 functions below to integrate;then the program performs the numeric integration and displays the result, or emits error messages where applicable.
The 3 functions f(x) are:
Detail:
1. In your C program, design a function that handles the input task:
Display a menu (a textual list) of the 3 mathematical functions above, and then:
Prompt the user to enter one of the following:
o A number associated with one of the functions in the list, or else:
o The character 'q' or 'Q' specifying the wish to quit.
If a number is entered by the user, check that it is within the range 1..3
If a non-number is entered, check if it is one of the 2 valid characters 'q' or 'Q'.
Whenever invalid input is entered, print a warning message and ask again for input.
Once valid input has been entered, display the user's choice by showing all parameters selected and the chosen function and proceed with the actual integration.
2. If the user's choice is to quit, exit the program, else proceed to the next step.
3. Ask for the values of the lower and upper integration limits a and b.
a and b are floating point numbers with b > a.
4. Write your own C function to implement the following sub-interval input task:
Ask for the desired number of sub-intervals N.
Assure N is an even integer number greater > 1.
As long as invalid input is entered, print a warning message and ask again for input.
Once valid input has been entered, print and then use N.
5. Write your own C function to integrate:
Perform the numeric integration of the selected function f(x) over the defined rangea..b.
Function f(x) calculates and returns the result of the integration, but does not display it.
6. Print the integration result to ten (10) decimal places.
7. Go back to Step #1 to let the user try another integration.