void inputData(int a[], int lastPlantNumber)
{
for(int plantNumber=1; plantNumber<=lastPlantNumber; plantNumber++)
{
cout<<endl
<<"Enter production data for plant number "<<plantNumber<<endl;
getTotal(a[plantNumber-1]);
}
}
void getTotal(int& sum)
{
cout<<"Enter the number of units produced by each department"<<endl;
cout<<"Append a negative number to the end of the list."<<endl;
sum=0;
int next;
cin>>next;
while(next>=0)
{
sum=sum+next;
cin>>next;
}