It would be grateful if anyone could help on this.
I am suppose to apply three constructors for the below WeeklySales class:
class WeeklySales {
char* salesPerson;
double* amount; // Pointer to an array
int noOfWeek; // Size of the array
};
There are the qns:
1) a parameterised constructor with the necessary parameters to initialise all the data members of a WeeklySales instance.
2) A default constructor that will initialise the data members salesPerson to “Unknown”, noOfWeek to 13 and amount to point to an array of thirteen 0.00s.
3) A copy constructor that will create a new WeeklySales instance and copy the values of the data members from an existing WeeklySales instance to the new WeeklySales instance.
4) Write a main function to demonstrate how each of these three constructors is being used.
How do I start writing the constructors and the main function? Any help would be much appreciated.