#include "Employee.h" #include using namespace std; Employee::Employee(const string & name, double salary, int companiesTotal) : name(name), salary(salary), companiesTotal(companiesTotal) { companies = new string[companiesTotal]; SetCompanies(); } Employee::~Employee() { delete[] companies; } void Employee::SetCompanies() { for (int i =0; i < companiesTotal; i++) { cout << "Please enter company " << i+1 << " name: "; cin >> companies[i]; } } void Employee::DisplayCompanies() const { for (int i = 0; i < companiesTotal; i++) { cout << "Company " << i+1 << " name: " << companies[i] << endl; } } bool Employee::SetRating(int index,int value) { if (index >= 0 && index < TOT_MONTHS) { ratings[index] = value; return true; } else { return false; } } int Employee::GetRating(int index) const { if (index >= 0 && index < TOT_MONTHS) { return ratings[index]; } else { return 0; } } void Employee::AddTodo(const string & item) { todo.push_back(item); } void Employee::DisplayTodoList() const { int size = todo.size(); for (int i = 0; i < size; i++) { cout << todo[i] << endl; } } void Employee::TodoComplete() { todo.erase(todo.begin()); } bool Employee::IsOverworked() const { return todo.size() > OVERWORKED; }