Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

i cant figure out where the problem is? #include<iostream> #include<cmath> #incl

ID: 3626602 • Letter: I

Question

i cant figure out where the problem is?

#include<iostream>
#include<cmath>
#include<fstream>
#include<cstdlib>
using namespace std;

//Global constants
const int M_R =100;
const int M_C =100;

//read in prototype
double read_in(const double Read[M_R][M_C]);
//average prototype
double avg(const double M[M_R][M_C], int irow, int icol);
//copy Value A to B
double copy_A(const double A[M_R], int NR, int NC);
//out data

double out_d(const double out[M_R][M_C]);

int main()
{
double read[M_R][M_C];
double store[M_R][M_C];

read_in(read);


return 0;
}

//Function for read in
double read_in(const double Read[M_R][M_C])
{

ifstream fin;
string input_f;
int r;
int c;
cout <<"enter file name:";
cin >>input_f;
fin.open(input_f.c_str(),ios::in);
if(!fin.isopen())
{
cerr <<"Unable to open file" <<input_f <<endl;
exit(10);
}
fin>>r,c;
while(!fin.fail())
{
cout<<"Read number of row and column:" << r << c <<endl;
fin >> r >>c;
}
if(r > M_R || c > M_C)
{
cout<<"Error the number is greater than the array limit";
}
while(fin.fail)
{
cerr <<"Error reading file" <<input_f<<endl;
exit(20);
}
fin.close();
}
//average function
double avg(const double M[M_R][M_C],int & irow, int & jcol)
{
double sum;
double average;
for(irow=0; irow<input_f-1; irow++)
{
for(icol=0; icol <input_f-1; icol++)
{
sum+=M[irow][icol]
average= sum/9.0;
}
}
return(average);
}

double copy_A(const double A[M_R][M_C], double B[M_R][M_C], int NR, int N)
{
for(int i=0; i<M_R; i++)
{
for(int j=0; j<M_C; j++)
{
if(

//copy smoothed values of array A into array B as follows:
/*foreach element (i,j) of array A do
if(i,j) is the first or last row or column containing input data then
B[i,j] <-- A[i,j]
else
B[i,j] <-- the average of A[i,j] and its eight neighbors;
end
end
*/









double out_d(const double out[M_R][M_C])
{
ofstream fout;
fout.open(out.data.c_str(),ios::out);
if(!fout.is_ipen())
{
cerr<<"unable to open file out.data" <<endl;
exit(10);
}
cout <<"Creating file:out.data" <<endl;

Explanation / Answer

#include #include #include using namespace std; void main() { ifstream ifile; ofstream ofile; string filename; int read[100][100]; int column, row; int max_c=100,max_r=100; coutmax_c) cout