Question: Please use simple C language No strings!!! And please do not use cout and cin instead use printf and scanf. 3. The How of toocic
3. The How of toocic waste through a permeable media (e-g. sol) can be modeled using differential equations (e.g. Darcy's Law). However, the diferential equations are hard to solve when the permeability changes from point to point (as in a real soil). One solution to the problem is to represent the permeability as sone sort of effective average. , x[n-1] stored in the Suppose that we have permeability readings xO], x[1] array x. Three possible averages are coanmonly used, depending on the nature of the toxic low problen; arithmetic average =- geometric average = exp ( log(112) harmonic average Write a program, permeability.c, which computes the three averages for a set of values stored in the file samples.txt. You can assume that theumber of values in the input file is kss than 100 Your ain must use the following steps: les.txt and samplesout.txt. . open the two files sanpl . read the values from samples.txt into an array x and determine the value of n (number of values in the fle) ecall three functions arithnetic, geonetric and harzonic to compute the corresponding averages write the three averages to t he file samplesout.txt arithmetic average should be 20.189125, your harmonic average To check your program, your a should be 15.677883 and your geometric average should be between these two values. / File: permeability.c A set of perneabilities is read fron a file into an array Three functions are called to compute the arithnetic, geonetric and harmonic averags Assignnent:5 Programser Date: Question: 3 DalID: Course: ENGM 1081 includetdio.h> include ath.h> #define MAXX 100 int zain (void)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
