Write a C++ program that loads a 101-by-101 array of integers from a data file (provided) . Invoke the “load-array” function to load the array (provided —see below) . Your program then should make use of a function that totals the elements on the middle row and center column of the array, and then returns that sum to the caller. Your program should display the result.
Provide your entire solution.
Code:
#define FILENAME “C:\\data.dat”
bool Load Array (mt array[] [101])
ifstream input_file;
input file.open (FILENAME)
if ( input_file)
cout << “Cannot Open Input Data File.” << endi;
return false;
for (mt row = 0; row < 101; ++row)
for (mt ccl = 0; ccl < 101; ++col)
input_file >> array[row] [col]
input file.close ()
return true;
Data of data.dat file:
72
-9
-99
// edit removed, even I know what 10.000 random numbers looks like