Please help soon as possible. with the c++ program. more info and 4,500 points a
ID: 3565483 • Letter: P
Question
Please help soon as possible. with the c++ program.
more info and 4,500 points avaliable at:
http://www.chegg.com/homework-help/questions-and-answers/please-help-3000-points-available-problem-go-http-wwwcheggcom-homework-help-questions-answ-q6004871
http://www.chegg.com/homework-help/questions-and-answers/please-help-comment-code-much-possible-would-appreciate--q6001431
Computer programs can greatly aid in many methods of numerical analysis. One such method is integration under a curve. The area under a curve can represent stored energy or other important properties. The area under a curve may be approximated by dividing the area into trapezoids, calculating the area of each trapezoid.. and then summing those smaller areas. For example., using the diagram below, the area under the curv e for the region from a to b could be approximated by dividing the region into 5 smaller areas. The first area can be defined by a, f(a), xis and f(xi). The area of a trapezoid is given by the equation area = 0.5 base (height i + height:). In our example of the first trapezoid the base is equal to xi - a, height i is equal to f(a), and height2 is equal to f(xi). Therefore the area of the first trapezoid is equal to 0.5(xi - a)(f(a) + f(xi)). Similarly, the area of the second trapezoid can be calculated as 0.5(x2-xi)(f(xi) + f(x2)) and the area for the third trapezoid is 0.5(x3 - x2)(f(x3) + f(x2)). The total area under the curve from a to b would be the sum of the 5 trapezoids. For this assignment you will find x, y data in a file called xydata.dat. (This is an ASCII file that can be opened with NOTEPAD or WORDPAD.) Copy this file to your computer or space on U-drive where your work. Open the file using notepad so you review the file, but do not edit the file in any manner and do not change the file name. Note the file contains two columns of data, one for x and one for y. Rather than using a function to calculate y at various points, the y values have already be measured and recorded for you. Consecutive pairs of x-y data should be used to designate the trapezoids, e.g. the first trapezoid would be defined by xl, yl, x2, and y2; the second trapezoid would be defined as x2, y2, x3, and y3; the third trapezoid by x3, y3, x4, and y4, etc. 1.Explanation / Answer
#include float start_point, /* GLOBAL VARIABLES */ end_point, total_area; int numtraps; main( ) { void input(void); float find_area(float a,float b,int n); /* prototype */ print(Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.