Hello all,
I would like to find the total value of sales during a specific month by each department and in each stores?
I'm having hard time to get total sale value for specific month by each department and in each stores.
Can Someone please help me in this matter
Thank you for taking the time to help.
Here's my code
#include <iostream>
#define NUM_DEPTS 2
#define NUM_STORES 2
#define NUM_MONTHS 12
using namespace std;
void sales(float sale[][NUM_STORES][NUM_MONTHS],int Month);
int main(){
int Month;
float sale[NUM_DEPTS][NUM_STORES][NUM_MONTHS] =
{ 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2,
2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2,
3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2,
2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2,
};
system("pause");
return 0;
}
void sales(int sale[][NUM_STORES][NUM_MONTHS], int Month){
int sum = 0;
for (int i = 0; i < NUM_DEPTS; i++){
for (int j = 0; j < NUM_STORES; j++){
for (int k = 0; k < NUM_MONTHS; k++){
sale[i][j][k];
cout << "The total sales value " << sale[i][j][k] << endl;
}
}
}
}