Hey guys, i'm new in C++ coding and I need some help with a programming challenge i was assigned. I am so confused on just how to do the highestPerQuarter function.
My code so far is:
#include <iostream>
using namespace std;
void totPerQuarter(int sales[][COLS])
{
for(int c = 0; c < COLS; c++)
{
int total = 0;
for(int r = 0; r > ROWS; r++)
{
total += sales[r][c];
}
cout << "Total: " << total << endl;
}
}
void highPerQuarter(int sales[][COLS])
{
}
double calcAverage(int sales[][COLS])
{
//Make Vars
int total = 0;
double avrg;
for(int r = 0; r < ROWS; r++)
{
for(int c = 0; c < COLS - 1; c++)
{
total += sales[r][c];
}
}
return (double)(total) / (ROWS * COLS);
}
void displayArray(int sales[][COLS])
{
cout << "Sales figures for each Quarter and each Division: ";
for(int r = 0; r < ROWS; r++)
{
for(int c = 0; c < COLS - 1; c++)
{
cout << " Division " << r+1 << "Quarter " << c+1 << ":" << sales[r][c];
}
}