Menu

[Solved] Following C M Need Help 2d Arrays Far Able Print Array Fine Random Every Time Run Trouble Q37267352

The following is for C++

I’m in need of help with 2d arrays. So far I am able to printout the array just fine (they are random every time you run it) butI have trouble with the following:

  

  • getAverage. This function should find the average of the wholearray.
  • getTotal. This function should find the total of the wholearray
  • getRowTotal. This function should find the total for eachrow
  • getColumnTotal. This function should find the total for eachcolumn
  • getHighestInRow. This function should find the highest value ineach row
  • getLowestInRow. This function should find the lowest value ineach row

Here’s my code so far:

#include
#include
#include
#include
using namespace std;

const int rows = 3;
const int col = 4;

void mean(int sum, int average);
void print();
int main()
{
   int sum, average;
   print();
   mean(sum, average);
}

void print()
{
   srand(time(0));
   int scores[rows][col];

   for (int rows = 0; rows < 3;++rows)
   {

       for (int col = 0; col <4;++col)
       {
          scores[rows][col] = rand() % 100 + 1;
           cout <<scores[rows][col] << ” “;
       }
       cout << endl;

   }
  
}

void mean(int sum,int average)
{
  

}

P.S. I would love to see notes off to the side on how you gotthere as it helps me greatly.

Expert Answer


Answer to The following is for C++ I’m in need of help with 2d arrays. So far I am able to print out the array just fine (they are… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *