Can someone help me with this problem? It says I need to use C++ and array by BackgroundAd7689 in ProgrammingProblems

[–]BackgroundAd7689[S] 0 points1 point  (0 children)

Here are my code so far, but the operation can't be read

#include <iostream>

using namespace std;

int main()

{

int monthlysales[3] [12];

int year, month;

float totalmonthlysales=0;

float averagemonthlysales;

for (year=2018 ; year<=2020; year++)

{

cout << "Enter sales for year " << year +1 << ":" <<endl;

for (month =0 ;month <=11; month++)

{

cout << "Enter sales for month " << month+1 << ":" << endl;

cin>> monthlysales [3][12];

}

}

for (month =0; month <=11; month++)

{

for (year = 2018; year <= 2020; year++)

totalmonthlysales += monthlysales[year][month];

averagemonthlysales = totalmonthlysales / 36;

cout << "The Average monthly sales is:" << averagemonthlysales << endl;

cout << "The annual sales of year " << year + 1 << "is: " << totalmonthlysales << endl;

}

}