Question: USING C++ trapezium function double trapezium(int trapezoids, double interval_start, double interval_end) { double span = (interval_end - interval_start) / trapezoids; int iter = 0; double

USING C++USING C++ trapezium function double trapezium(int trapezoids, double interval_start, double interval_end) {double span = (interval_end - interval_start) / trapezoids; int iter = 0;

trapezium function

double trapezium(int trapezoids, double interval_start, double interval_end) { double span = (interval_end - interval_start) / trapezoids; int iter = 0; double sum = 0; double x_0 = interval_start; while (iter B. (20 points) Approximating the Value of the Fresnel Integral, C(x) The Fresnel integrals: cos ( ) dt and S(x) sin (- ) dt appear in a number of areas of science and engineering Write a C++ program that has the user input a positive value x (of type double) and a positive value MaxTrapezoids (of type int), and then approximates C(x) using the Trapezium integration method First approximate C(r) using the Trapezium method with 1 trapezoid, then with 2 trapezoids, and so on, each time increasing the number of trapezoids by one until the last estimate uses MaxTrapeziods trapezoids. For each approximation, the program should print out the number of trapezoids used in that estimate and the result of the estimate. This process should be in a user-controlled continuation loop, as shown in the following example (user input is in Bold font): Enter x: 3.14159265 Enter # of Estimates (trapezoids): Estimates 1 2 C(x) 0.03283499 1.14969834 0.71268699 0.72872487 0.05055231 Continue? (y): y

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!