urgent! can someone help me please, what am I doing wrong?

what do i need to add? or remove? answer asap please

#include <iostream>

using namespace std;
class DivSales
{
private:
//variable declaration
int quarterSales[4];
static double totalSales;
public:
void add(int, int, int, int);
int sales(int);
static double getValue()
{
return totalSales;

}

};
//add function
void DivSales add(ints1, ints2, ints3, ints4)
{
quarterSales[0] = s1;
quarterSales[1] = s2;
quarterSales[2] = s3;
quarterSales[3] = s4;
totalSales = totalSales + s1 + s2 + s3 + s4;

}
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 <<"\t" << "Q1" <<"\t" << "Q2" <<"\t" << "Q3" <<"\t" << "Q4" <<endl;
cout << "____________________________\n";
for (i=0;i<6;i++)
{
cout << "Div " <<i+1<<"|";
for(j=0;j<4;j++)
cout<<"t"<<ds[i].sales(j);
cout<<endl;

}
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)

Firstly, if a function is part of the class, you used double Colon, read more about how classes works - http://www.cplusplus.com/doc/tutorial/classes/

Secondly, there needs to be space after "int" in the arguments.

Here is what it should look like - void DivSales::add(int s1, int s2, int s3, int s4)

Tell us, what is wrong? what errors are you getting? Copy and paste them.
Topic archived. No new replies allowed.