Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program in C++ that reads a data file and determine the first, second, a

ID: 3828041 • Letter: W

Question

Write a program in C++ that reads a data file and determine the first, second, and third order derivatives from the data. The program should:

Print output to screen and a file.

For the file output: Write data to a file with the columns Station, Time, Velocity, Acceleration, and Jerk. in columns separated by 5 spaces. Be sure to write a header column first. Your numbers should have the same number of decimals as the data in the table below.

Call on a single function to determine the relevant quantity – do not define any new functions.

Compute each quantity for each time at the same point in the program.

Use the forward difference for the first data point,

Use the backward difference for the last data point,

Use the central difference for all data points in between.

Use the program on the problem below:

The displacement data to use as the input file is as follows:

Station, i Time, ti(sec) Displacement, yi (inch)
1 .05 .144
2 .10 .172
3 .15 .213
4 .20 .296
5 .25 .070
6 .30 .085
7 .35 .525
8 .40 .110
9 .45 .062
10 .50 .055
11 .55 .042
12 .60 .035

Determine the velocity, acceleration, and jerk at each instant and print these to a file

Explanation / Answer

#include #include #define MAXSIZE 10 void main() { int array[MAXSIZE]; int i, num, power; float x, polySum; printf("Enter the order of the polynomial "); scanf("%d", &num); printf("Enter the value of x "); scanf("%f", &x); /* Read the coefficients into an array */ printf("Enter %d coefficients ", num + 1); for (i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote