Question
Assignment 4 : Structured Programming In C Language The task is to create second-degree polynomial calculator for the function, its integral and its derivative. A
Assignment 4: Structured Programming In C Language
The task is to create second-degree polynomial calculator for the function, its integral and its derivative. A second-degree polynomial is described by the equation:
Evaluation of the derivative gives the instantaneous slope or rate of change as (where is the derivative of ):
The integral of the function (let us call it ) indicates the area underneath the curve. Between points and , the area A is
where, for a second-degree polynomial,
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 will enter the polynomial coefficients {a,b,c} as well as the starting value of x (denote it xi), the final value of x (denote it xf), and the increment value between successive x values (denote it ).
Follow these detailed instructions:
1.Create a function of type void to explain the program to the user with the description printed to the terminal. Do not forget to call the function from the main().
2.Input the data while executing from your main() function. Query the user to enter the data. You must enter the parameters from the user in the following order: a, b, c and then xi, xf and . Use double for all variables and calculations.
3.Your program is to loop over all possible x values in your function. The first x value is to be xi, the second xi+, etc. with the last value being xf (or somewhat less than xf if does not divide evenly into the range).
4.The calculation of the area A depends on the initial value of x, xi.That is, for each x, we calculate the area as . In order to calculate A, you must know both x and xi. For the first value of x, it should be that A is zero.
5.From the main() and for each x, you are to call a call-by-reference function that accepts a, b, c, x and xi that calculates and returns (via pointer operations) f(x), f'(x) and A. That is, you must create a single function that accepts five input parameters (a, b, c, x and xi), and returns three outputs (related to f(x), f'(x) and A). There must not be any scan/print statements in your function.
6.Your function uses the values of a, b and c along with the value of x to compute . Similarly, the derivative is computed as . Then, using xi in addition to the other parameters, compute and . The area is found as . Return the result of your calculations back to the function (it will be necessary to reference your outputs via pointers).
7.All output for your table of x versus f(x), f'(x) and A must be displayed via statements in your main() function. Write your table to the terminal (i.e., the default output for printf()). Choose a suitable format for your output numbers.
f(x) = ar2 + br+ c f(x) = ar2 + br+ c
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started