Code:

/* Preprocessor directives */
#include <stdio.h>
#include <math.h>
#define prop_mass 1.54
#define infile "C:\\Users\\tommc\\OneDrive\\Documents\\ENGR 200\\\
time-thrust.txt"
#define outfile "C:\\Users\\tommc\\OneDrive\\Documents\\ENGR 200\\\
impulse-thrust.txt"
/* function prototypes */
int get_i_t(double);
int get_i_sp(double);
int get_f_avg(double);
/* Main function */
int main(void)
{
/* Declare variables */
double i_t, calc_it, calc_sp, calc_f_avg, i_sp, f_avg, delta_t, t, F, f_tot,
t_tot;
int i, ndata;
FILE *time=NULL, *impulse=NULL;
/* open files */
time=fopen(infile, "r");
impulse=fopen(outfile, "w");
/* Print headings */
printf("********************************************");
printf("\n ROCKET MOTOR TEST RESULTS");
fprintf(impulse,"********************************************");
fprintf(impulse,"\n ROCKET MOTOR TEST RESULTS");
/* Verify input file and terminate program if file not found */
if(time==NULL)
{
printf("\n\n\n\n ERROR OPENING INPUT FILE.");
printf("\n\n PROGRAM TERMINATED.\n\n\n");
return 1;
}
/* Read control number */
fscanf(time, "%i", &ndata);
/* Calculate specific impulse and average thrust */
i_t = get_i_t(calc_it);
i_sp = get_i_sp(calc_sp);
f_avg = get_f_avg(calc_f_avg);
/* Print output values */
printf("\n\nTotal Impulse: %5.1lf", i_t);
printf(" lb-sec");
printf("\nSpecific Impulse: %5.1lf", i_sp);
printf(" sec");
printf("\nAverage Thrust: %5.1lf", f_avg);
printf(" lb");
printf("\n********************************************\n\n\n");
fprintf(impulse, "\n\nTotal Impulse: %5.1lf", i_t);
fprintf(impulse, " lb-sec");
fprintf(impulse, "\nSpecific Impulse: %5.1lf", i_sp);
fprintf(impulse, " sec");
fprintf(impulse, "\nAverage Thrust: %5.1lf", f_avg);
fprintf(impulse, " lb");
fprintf(impulse, "\n********************************************\n\n\n");
/* Close the files */
fclose(time);
fclose(impulse);
/* Exit the program */
return 0;
}
get_i_t(double calc_it)
{
double calc_i_t, delta_t, F, t;
int i, ndata;
FILE *time=NULL;
time=fopen(infile, "r");
fscanf(time, "%i", &ndata);
for (i = 0; i <= ndata; i++)
{
fscanf(time, "%lf,%lf,%lf", &t, &delta_t, &F);
calc_it += delta_t * F;
}
fclose(time);
return calc_it;
}
get_i_sp(double calc_sp)
{
/* Declare variables */
double i_t, i_sp, delta_t, F, t;
int i, ndata;
FILE *time=NULL;
time=fopen(infile, "r");
fscanf(time, "%i", &ndata);
for (i = 0; i <= ndata; i++)
{
fscanf(time, "%lf,%lf,%lf", &t, &delta_t, &F);
i_t += delta_t * F;
}
calc_sp = i_t / prop_mass;
fclose(time);
return calc_sp;
}
get_f_avg(double f_avg)
{
/* Declare variables */
double i_t, delta_t, t, F, t_tot, calc_f_avg;
int i, ndata;
FILE *time=NULL;
time=fopen(infile, "r");
fscanf(time, "%i", &ndata);
for (i = 0; i <= ndata; i++)
{
fscanf(time, "%lf,%lf,%lf", &t, &delta_t, &F);
i_t += delta_t * F;
t_tot = t;
}
calc_f_avg = i_t / t_tot;
fclose(time);
return calc_f_avg;
}

Also, this is the contents of the external file