Ok here is the taskings: The objective of the lab is to take the UML Class diagram and enhance last week's Employee class by making the following changes:
Create a static variable called numEmployees that holds an int and initialize it to zero. This will allow us to count all the Employee objects created in the main class.
Increment numEmployees in all of the constructors
Add overloaded versions of setDependents and setAnnualSalary that accept strings. This way, we will have two "set" methods for both dependents and annual salary; one that accepts a string, and one that accepts its default data type.
There is a convention that one should name the member variables with a leading m_ , so you could do this:
m_FirstName = firstName;
this->firstName = firstName;
Also, you code hard wires 2 employees, it would be better if you used a vector of employees, then you could use a loop to enter their info, and an iterator to do things with them. You should always avoid repeating code to deal with multiple objects.
Another convention is to put the class declaration into it's own header file, with the definitions of the functions in it's own .cpp file. Then include the header file in whichever file needs to use the class. If you are using an IDE, it can do this for you - plus a whole lot of other stuff as well.
With functions that are used by main, declare these before main, then provide definitions of them after main. Consider making the GetUserInput a class function, because it is about the class info.
HTH - look forward to seeing what your question was. :)
the question is how can i add the numEmployee and make it initialize to zero and also when the program runs how can i make it count how many people i used in the program. the hard coded personel are intended