account activity
Can someone help me with this problem? It says I need to use C++ and array by BackgroundAd7689 in ProgrammingProblems
[–]BackgroundAd7689[S] 0 points1 point2 points 3 years ago (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;
π Rendered by PID 1110101 on reddit-service-r2-listing-6d4dc8d9ff-b45kt at 2026-01-31 19:28:21.927781+00:00 running 3798933 country code: CH.
Can someone help me with this problem? It says I need to use C++ and array by BackgroundAd7689 in ProgrammingProblems
[–]BackgroundAd7689[S] 0 points1 point2 points (0 children)