I fix your logic though (it's wrong)
//these should be private data members
//for an array, you must either specify a size or use a
//pointer and dynamically allocate memory. I used a pointer:
//functions should only be defined in the class body.
//your implementations should be somewhere else.
//this is a destrctor. we need it in this case because we
//dynamically allocated memory that needs to be freed up.
//when the class runs out of scope, this is automatically called
//here's the implementation for the constructor. Usually constructors only
//initialize the class. putting this much functionality into your constructor
//should probably be avoided.
numsmone = nums - 1;
//here I'm dynamically allocating the memory for the array
for (x = 0; x < nums; ++x)
if (x == 0)
cout << "Enter the 1st number: ";
else if (x == 1)
cout << "Enter the 2nd number: ";
else if (x == 2)
cout << "Enter the 3rd number: ";
cout << "Enter the " << x << "th number: ";
cin >> numbers[x];
//this is the destructor. don't worry about calling it.
//this deallocates the memory from before.
for (x = 0; x < numsmone; ++x)
mean = numbers[x] + numbers[x+1];
mean = mean / (numsmone + 1); //forgot a semicolon
int main ()
cout << "Enter the number of numbers you wish to average: ";
cin >> nums;
//on this next line, you forgot the (), and you're supposed to use the
//dot (.) operator, not the scope resolution operator (::)
cout << "The mean is " << Avgone.calculateMean();