Accumulating Totals in a Loop
const int DAYS_IN_WEEK = 7;for(counter = 1; counter <= DAYS_IN_WEEK; counter++){cout ≪ "Enter rainfall amount for Day " + counter ≪ ": ";cin >> rainfall;cout ≪ "Day " ≪ counter ≪ "rainfall amount is " ≪rainfall ≪ " inches" ≪ endl;sum += rainfall;}// calculate averageaverage = sum / DAYS_IN_WEEK;Could you replace DAYS_IN_WEEK in the statement average = sum / DAYS_IN_WEEK; with the variable named counter and still get the desired result? Explain.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.