Menu

Program Used Create Table Data Independent Variable X Versus F X F X User Enter Polynomia Q43886459

Your program will be used to create a table of data of theindependent variable x versus
f(x), f'(x) and A. The user will enter the polynomialcoefficients {a,b,c} as well as the starting value of x(denote it xi), the final value of x (denote itxf), and the increment value between successivex values (denote it delta x).

  1. First, read this document in its entirety. After reading thishandout, you may optionally create a design sheetfor the problem. Your design sheet should help you determine whatheader files, functions and variables you will need as well asidentifying expected test results. You doNOT turn in your design sheet.
  2. When you write your code, include the usual (detailed) commentblock including program name, author, date, inputs, outputs, anddescription.
  3. Create a function of type void to explain theprogram to the user with the description printed to the terminal.Do not forget to call the function from main().
  4. Input the data while executing from your main() function. Querythe user to enter the data. You must enter theparameters from the user in the following order: a, b, cand then xi, xf, and delta x. Use double forall variables and calculations.
  5. Your program is to loop over all possible x values inyour main() function. The first x value is to bexi, the second xi  + delta x etc.with the last value being xf (or somewhat less thanxf if deltaX does not divide evenly into therange).
  6. The calculation of the area A depends on the initialvalue of x, xi . That is, for each x, wecalculate the area as F(x) = F(x) – F(xi) . In order tocalculate A, you must know both x andxi. For the first value of x, it should be thatA is zero.
  7. From main() and for each x, you are to call a functionthat accepts a, b, c, x and xi Calculate and return (viapointer operations) f(x), f'(x) and A. That is, you must create asingle function that accepts eight inputs– five arecall-by-value (a,b,c,x,xi) and three are call byreference (pointers for f(x), f'(x) and A). no scan or printstatements.
  8. Your function uses the values of a, b and calong with the value of x to compute f(x) = ax2+ bx+ c f'(x) = 2ax +b and with xi compute F(x) = =a/3×3 + b/2×2 + cx and F(xi) =a/3xi3 + b/2xi2 +cxiand finally the area A = F(x) – F(xi). Return the resultof your calculations back to the main() function (it will benecessary to reference your outputs via pointers).
  9. All output for your table of x versus f(x),f'(x) andA must be displayed via statements in your main()function. Write your table to the terminal (i.e., the defaultoutput for printf()). Choose a suitable format for your outputnumbers.
  10. Assume that the user enters 2.0 -2.0 -1.0 for a, b, c,respectively, and 0.0 5.0 0.25 for xi, xf anddelta x, respectively.

Expert Answer


Answer to Your program will be used to create a table of data of the independent variable x versus f(x), f'(x) and A. The user wil…

OR