// Employee Implementation File // #include #include "Person.h" #include "Employee.h" #include #include #include Employee::Employee() : Person() { emplid = ""; password = ""; } Employee::Employee(string inName, string inEmplid, string inPassword) : Person(inName) { emplid = inEmplid; password = inPassword; } string Employee::getEmplid() { return emplid; } string Employee::getPassword() { return password; } string Employee::getName() { return Person::getName(); } string Employee::getEmpPassword(vector employeesVec, string inPassword) // will return the users name { auto it = find_if(employeesVec.begin(), employeesVec.end(), [&inPassword](Employee& obj) { return obj.getPassword() == inPassword; }); Employee tempU = *it; return tempU.getName(); } string Employee::getEmpName(vector employeesVec, string inEmplid) // must return the user name to compare to functions above returned name { auto it = find_if(employeesVec.begin(), employeesVec.end(), [&inEmplid](Employee& obj) { return obj.getEmplid() == inEmplid; }); Employee tempU = *it; return tempU.getName(); } bool Employee::emplidCheck(vector employeesVec, string inEmplid) { auto it = find_if(employeesVec.begin(), employeesVec.end(), [&inEmplid](Employee& obj) { return obj.getEmplid() == inEmplid; }); // searches vector for the employees ID (inEmplid). This code took a long time to get working. if (it != employeesVec.end()) { return true; } else { return false; } } bool Employee::passwordCheck(vector employeesVec, string inPassword) { auto it = find_if(employeesVec.begin(), employeesVec.end(), [&inPassword](Employee& obj) { return obj.getPassword() == inPassword; }); if (it != employeesVec.end()) { return true; } else { return false; } } void Employee::print() { cout << "Employee Name: " << Person::getName() << ", Employee ID: " << emplid << ", Password: " << password << endl; }