I am currently working on a class project and am having difficulties figuring out how to properly execute my code and what to include into main.cpp. I am to create a vector of employees (ability to add/remove them), create an office directory, and include estimated burn rate. I have included the more specific instructions in the comments of my "Office.h" file. Here is what I have so far:
I am to create a vector of employees (ability to add/remove them), create an office directory, and include estimated burn rate.
From an Object Oriented Design perspective, OfficeDirectory is associated with a collection of Employee. BurnRate is a calculation of some sort. You'd need to specify what the calculation is to yield that value to know exactly what to do with it.
In code, you might define your objects as:
1 2 3 4 5 6 7 8 9 10 11 12
class Employee
{
//...
};
typedef std::vector<Employee> Employees;
class OfficeDirectory
{
Employees m_employees;
//...
};
In my view, you shouldn't add getters/setters. Decide what operations you need on an object and provide methods to support them. Just because your object has a member, m_firstname doens't mean you should automatically have methods getFirstName() / setFirstName(). Objects are not records.