Help with Array for objects

Hello...im confused on how to go about creating an Array for objects in a class. This is what is specified to occur in the main()...

element 0 - use a mutator to set values
element 1 - prompt and obtain from keyboard and use mutator method to initialize the array
element 2 - prompt and obtain from keyboard , define an object using a two argument constructor..passing the values entered from keyboard, assign object to element 3
element 3 - use accessor and mutator methods to set one of the values to the value in element 0 and another value to set to element 2.

I have the mutators, accessors, and constructors done..just don't know how to go and make this part work....
Any explanation or an example would be great to understand what is needed for this. Thanks...

Your code looks okay until here. I haven't compiled it or anything, but looks acceptable. Let's start from here, anyway.

What does n++ mean? It means that you use the original value of n to do whatever you want, then increment the value of n by 1 after you are done using the original value. Using your code:

moneyArray[n++].getDollars();
moneyArray[n++].getCents(); //element 1

the first line will use the accessor getDollars() to return the dollar member for moneyArray[0] since n == 0 at this point. Then it increments n to 1. The value returned by the function is ignored so it's an illogical, but legal, call to the accessor function. After the first line is done n is 1 so the call to getCents() is now going to return the value of cents in moneyArray[1], which is undefined at this point then ignore the return value, again, and finally increment n to 2. I recommend you focus on using the accessor and mutator functions, and hardcode the index values, dropping n altogether, like this:

moneyArray[0].setCents(.0000);

Now let's take up the accessor function calls. Unless you use the return value somehow it doesn't make any sense to call them. Use them with cout to display the value in an instance of CanadianMoney like this:

Now let's turn to amount. It is a single variable. You can send it to setDollars() and setCents() both if you wish, but it would make more sense to get two user inputs, one to be used for dollar and one to be used for cents. Call them amount1 and amount2. Then send amount1 to setDollar() and amount2 to setCents().

For element two you ask for input for dollar and cents and store them in two different variables, x and y would be fine again. Then you use x and y as arguments to a new instance of CanadianMoney--say money102 like this:

CanadianMoney money102(x, y);

instead of doing what you did for money3. Then you assign money102 to moneyArray[2].

For element 3 you assign the values of element 0 to money1. You can either use the default assignment operator or do it explicitly by sending the return value of getDollars() to setDollars(), etc. Then ask for user input into x, and send x to money1.setDollars() or setCents(), whichever you prefer. Then assign money1 to element 3 of moneyArray.