Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c programming Develop a C program that processes a file called f1.txt and f2.txt containing a sequence of real-valued numbers. Your program should calculate and
c programming
Develop a C program that processes a file called "f1.txt" and "f2.txt" containing a sequence of real-valued numbers. Your program should calculate and display Mean of data from f1.txt Mean of data from f2.txt Standard Deviation of data from f1.txt Standard Deviation of data from f1.txt Correlation between the data contained in the files. Length is the number of data points in each of the files. You must use the following user-defined functions in your code #define SIZE 500 void read_file(FILE *inp, double z[], int length);//read_file-read data from the text file pointed to by inp and keep all data points in the array z void calc_mean(int length, double z[], double *mean);//calc_mean-find mean of data points in the array z with number of elements = length void calc_std(int length, double z[], double *std);//calc_std-find standard deviation of data points in the array z with number of elements = length If x and y are arrays containing the sequence of number that were read then corr(x, y) = sigma^499_i = 0 (x_i - m_x)(y_i - m_y)/500 s_y s_x where s_y = squareroot (1/500 sigma^499_i = 0 y^2_i) - (1/500 sigma^499_i = 0 y_i)^2 s_x = squareroot (1/500 sigma^499_i = 0 x^2_i) - (1/500 sigma^499_i = 0 x_i m_y = 1/500 sigma^499_i = 0 y_i m_x = 1/500 sigma^499_i = 0 x_i Mean of data in f1.txt is 2.03440 Mean of data in f2.txt is 3.01058 Standard deviation of data in f1.txt is 0.97672 Standard deviation of data in f2.txt is 1.00190 The correlation is 0.25396Step 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