to start off thanks for the help in advance, im trying to make a program that calls a function that i input integers into, then calling another function to calculate the total of the numbers entered.
here is my source code:
#include <cstdlib>
#include <iostream>
using namespace std;
const int LOT = 5;
const int MON = 12;
int sales_input(int [], int);
void sales_total(int [], int);
int main()
{
int month_sales[MON];
sales_input(month_sales, MON);
month_sales = sales_input(month_sales, 12);
sales_total(month_sales, MON);
system("PAUSE");
return EXIT_SUCCESS;
}
int sales_input(int month_sales[], int MON)
{
int num1, total;
for(num1 = 0; num1 < 5; ++num1)
{
cout << "enter total sales for lot " << (num1 + 1);
for(int num = 0; num < MON; ++num)
{
cout << "\ntotal sales ";
cin >> month_sales[num];
}
}
}
void sales_total(int month_sales[], int)
{
int total = 0;
for(int num2 = 1; num2 < 60; num2++)
total += month_sales[num2];
cout << "total= " << total;
}