Complete/Modify the code given in quiz3.cpp to calculate the avgand the std deviation of the array a and write the output once tomyquiz3outf.txt, and another time to a file to myquiz3outc.txt.(You must write one function for the mean(avg) and one function forthe std.
side note: ***for the string ifilename, the folder name that thefils are under is \"bte320\" and the \"numbers.txt\" that it isreferencing is pasted below***
CODE:
#include
#include
#include
#include //new g++ is stricter - it rquires it forexit
using namespace std;
int max(int a[],int dsize){
 Â
if (dsize>0){
int max=a[0];
for(int i=0;iif(a[i]>max){
max = a[i];
}
}
return max;
}
return -9999999;
}
int min(int a[],int dsize){
 Â
if (dsize>0){
int min=a[0];
for(int i=0;iif(a[i]min = a[i];
}
}
return min;
}
return -9999999;
}
void printArray(int array[],int dsize){
for(int i=0;icout << array[i];
if(icout << \" \";
}
cout << endl;
}
void fillArray(int array[],int &dsize, ifstream&fin){
 Â
int i=0;
while(!fin.eof()){
fin >> array[i];
i++;
}
dsize =i;
 Â
}
int main(){
ifstream fin;
ofstream fout;
stringifilename=\"/home/ec2-user/environment/bte320/numbers.txt\";
 Â
int const asize=100;
int a[asize];
int dsize=0;
 Â
fin.open(ifilename.c_str()); //make sure you use the c_str the newg++ uses it
if(!fin){ cout<< \"Error opening inputfile\"<fillArray(a,dsize,fin);
printArray(a,dsize);
cout <<\"Min Value:\" << min(a,dsize) <cout <<\"Max Value:\" << max(a,dsize) <Â Â
return 0;
}
ARRAY FILE (numbers.txt):
559870332844778756312278