}
int DivSales::sales(int n)
{
int value = quarterSales[n];
return value;
}
//error method
void error()
{
cout << "You have entered a negative value \nRestart program and try again";
cout << "\nPress any key to restart program\n";
system("pause");
exit(0);
}
//initialize totalSales
variable double DivSales totalSales = 0.00;
//Start main function
int main()
{
DivSales ds[6];
int i, j;
for (i=0; i<6, i++)
{
int s1, s2, s3, s4;
cout << "\nEnter Sales of Division. "<<i+1<<endl;
cout << "Enter Q1 Sales: ";
cin >>s1;
if(s1<0)error();
cout << "Enter Q2 Sales: ";
cin >>s2;
if(s2<0)error();
cout << "Enter Q3 Sales: ";
cin >>s3;
if(s3<0)error();
cout << "Enter Q4 Sales: ";
cin >>s4;
if(s4<0)error();
ds[i].add(s1, s2, s3, s4);
}
cout << "____________________________\n";
cout<<"\nTotal All Division Sales for the Year: " <<ds[0].getValue()<
//Pause the system for a while
system("pause");
A couple of things from what I can see. Firstly, please use code tags for your code, and indent your code, use spaces, it looks like a mess - http://www.cplusplus.com/articles/jEywvCM9/
I'll point out two wrong thing - void DivSales add(ints1, ints2, ints3, ints4)