Question: Please have me answer after reading the question and those file. Please give me correct answer This is the question below this is getInput.c file
Please have me answer after reading the question and those file. Please give me correct answer
This is the question below

this is getInput.c file

This is Statistics.c file

This is Statistics.h file

Modify the output stream of the program runProgram and add functions to compute statistics in the file statistics.c. Currently the program reads in a stream of integers from standard input. It assumes that there is 1 integer per line. The program starts reading when it encounters a non-positive number or character. YOU will need to add below statistics to statistics.c (and edit add prototypes to statistics.h), so that each statistics is computed in a separate function, also you will need to refine the output (in the function drivers() in the file getInput.c), so it looks exactly as depicted below" Input file (read from standard Input) vrair 2 4 1 3 XXX Outputs exactly (line up the ":"): Sum: 10.00 Average: 2.50 Sum of Squares : 30.0 Sample Variance: 1.25 Minimum: 1 Maximum: 4 Moba TextEditor File Edit Search Format Special Tools View XE Encoding Syntax LE vOWN statistics.h statistics.c getInput.c 1 #include 2 3 4 #define MAX_LINE 80 5 6 // functions from statistics.c, prototype is in statistic.h 7 #include "statistics.h" 8 9 10 /* 11 getIntegerLine() 12 * returns a positive integer from a line of input 13 14 Assumption: assumes proper input. 15 */ 16 int getIntegerLine() 17 { 18 char line [MAX_LINE]; 19 int return_user_int=-1; 20 21 fgets( line, sizeof( line ), stdin); 22 while( sscanf( line, "%d", &return_user_int ) != 1 ) 23 { 24 // Not a positive integer - indicates end of input 25 return -1; 26 } 27 return return_user_int; 28 } 29 30 31 /* --- 32 * prompts user for input. 33 */ 34 void promptList() 35 { 36 printf(" Assumes proper input "); 37 printf(" Type a list of non-negative integers, below, one integer per line " ); 38 printf(" Indicate the END of input with any letter (a-z): ->" ); 39} 40 41 42 43 void driver) 44 { 45 int anumber=-1; 46 47 promptlist(); 48 49 while( (anumber = getIntegerLine()) >= 0 ) 50 { 51 52 printf("Entered ---> %d -> ", anumber ); 53 54 printf("Running Average ---> %4.21f -> ", running_average ( anumber ) ); 55 } 56 57 printf("End of input "); 58 59} 60 61 MobaTextEditor Edit Search File View Format Encoding Syntax Special Tools XE statistics.h statistics.c getInput.c 1 11 00V UWN 3 double running_average( int add_number ) 4{ static double total numbers = 0; static double total_sum 0; 6 total_sum = total_sum + (double) add_number; total_numbers += 1; 9 10 return total_sum / total_numbers; 11 12 } 13 File Edit Search Special Tools View Format Encoding Syntax XER** statistics.h statistics.c getInput.c 1\/ only include declaration once, by defining prepprocessor 'dummy variable' 2 #ifndef STATISTICS_H 3 #define STATISTICS_H 4 5 6 extern double running_average( int add_number ); 7 8 9 10 #endif 11 12 Modify the output stream of the program runProgram and add functions to compute statistics in the file statistics.c. Currently the program reads in a stream of integers from standard input. It assumes that there is 1 integer per line. The program starts reading when it encounters a non-positive number or character. YOU will need to add below statistics to statistics.c (and edit add prototypes to statistics.h), so that each statistics is computed in a separate function, also you will need to refine the output (in the function drivers() in the file getInput.c), so it looks exactly as depicted below" Input file (read from standard Input) vrair 2 4 1 3 XXX Outputs exactly (line up the ":"): Sum: 10.00 Average: 2.50 Sum of Squares : 30.0 Sample Variance: 1.25 Minimum: 1 Maximum: 4 Moba TextEditor File Edit Search Format Special Tools View XE Encoding Syntax LE vOWN statistics.h statistics.c getInput.c 1 #include 2 3 4 #define MAX_LINE 80 5 6 // functions from statistics.c, prototype is in statistic.h 7 #include "statistics.h" 8 9 10 /* 11 getIntegerLine() 12 * returns a positive integer from a line of input 13 14 Assumption: assumes proper input. 15 */ 16 int getIntegerLine() 17 { 18 char line [MAX_LINE]; 19 int return_user_int=-1; 20 21 fgets( line, sizeof( line ), stdin); 22 while( sscanf( line, "%d", &return_user_int ) != 1 ) 23 { 24 // Not a positive integer - indicates end of input 25 return -1; 26 } 27 return return_user_int; 28 } 29 30 31 /* --- 32 * prompts user for input. 33 */ 34 void promptList() 35 { 36 printf(" Assumes proper input "); 37 printf(" Type a list of non-negative integers, below, one integer per line " ); 38 printf(" Indicate the END of input with any letter (a-z): ->" ); 39} 40 41 42 43 void driver) 44 { 45 int anumber=-1; 46 47 promptlist(); 48 49 while( (anumber = getIntegerLine()) >= 0 ) 50 { 51 52 printf("Entered ---> %d -> ", anumber ); 53 54 printf("Running Average ---> %4.21f -> ", running_average ( anumber ) ); 55 } 56 57 printf("End of input "); 58 59} 60 61 MobaTextEditor Edit Search File View Format Encoding Syntax Special Tools XE statistics.h statistics.c getInput.c 1 11 00V UWN 3 double running_average( int add_number ) 4{ static double total numbers = 0; static double total_sum 0; 6 total_sum = total_sum + (double) add_number; total_numbers += 1; 9 10 return total_sum / total_numbers; 11 12 } 13 File Edit Search Special Tools View Format Encoding Syntax XER** statistics.h statistics.c getInput.c 1\/ only include declaration once, by defining prepprocessor 'dummy variable' 2 #ifndef STATISTICS_H 3 #define STATISTICS_H 4 5 6 extern double running_average( int add_number ); 7 8 9 10 #endif 11 12