#include "stdafx.h" #include using namespace std; #define NUM_YEARS 10 #define NUM_STATES 50 void calcSoyProdPerYearAcrossAllStates(const int soy_prod[][NUM_STATES], int total_yearly_prod[]); int main() { int SoyProd[NUM_YEARS][NUM_STATES]; int totalYearlyProd[NUM_YEARS]; int totalStateProd[NUM_STATES]; // calculate soy prod per year across all states calcSoyProdPerYearAcrossAllStates(SoyProd, totalYearlyProd); return 0; } void calcSoyProdPerYearAcrossAllStates(const int soy_prod[][NUM_STATES], int total_yearly_prod[]) { for (int y = 0; y < NUM_YEARS; y++) { total_yearly_prod[y] = 0; for (int s = 0; s < NUM_STATES; s++) total_yearly_prod[y] += soy_prod[y][s]; } }