int main () { Employee emp(10,20,30); VendorBusiness(emp,&Employee::fun1); Employee emp1(11,21,31); VendorBusiness(&emp,&Employee::fun2); return 0; }
int main() { Employee emp1("vektor",3); Manager mgr1("dewanto",1,1); std::vector<Employee> emps; emps.push_back(emp1); emps.push_back(mgr1);// M a n a g e r can be used wherever an E m p l o y e e is acceptable }
int whichEmpty(const ECString& emp) { //return 1; // should make system not require empty type to be correct. if(emp == "0") return NULLEMP; if(emp == "*U*") return UNITEMP; int sz = emp.length(); if(sz < 1) { return 0; } if(sz >= 5) { //ECString emp1(emp.substr(0, 5)); ECString emp1(emp,0,5); if(emp1 == "*NOT*") return NOTEMP; if(emp1 == "*RNR*") return RNREMP; if(emp1 == "*ICH*") return ICHEMP; if(emp1 == "*EXP*") return EXPEMP; if(emp1 == "*PPA*") return PPAEMP; } if(sz >= 3) { //ECString emp1(emp.substr(0, 3)); ECString emp1(emp,0, 3); if(emp1 == "*T*") { return TREMP; } if(emp1 == "*NOT*") return NOTEMP; if(emp1 == "*?*") return QEMP; } //ECString emp2(emp.substr(0,1)); ECString emp2(emp,0,1); if(emp2 == "*") return NPEMP; return 0; }
TEST (test_person, test_list_employees) { Person jlp("Jean Luc Piccard"); Person wc("Wesley Crusher"); Employer emp1("Star Fleet Federation", "galaxy"); Position cpt("captain", "the big boss"); Position lieut("lieutenant", "second in command"); emp1.hire(jlp, cpt); emp1.hire(wc, lieut); EXPECT_EQ(emp1.getNbEmployees(), 2); EXPECT_STREQ(jlp.getEmployer().c_str(), emp1.getName().c_str()); EXPECT_STREQ(wc.getEmployer().c_str(), emp1.getName().c_str()); }
int main () { Employee emp1 (101, "sachin1"); Employee emp4 (102, "sachin2"); Employee emp2 (103, "sachin3"); Employee emp3 (104, "sachin4"); Stack<Employee> st2; st2.Push(emp1); st2.Push(emp2); st2.Push(emp3); st2.Push(emp4); st2.List(); cout << "--------------------------------------------" << endl; st2.Sort(); st2.List(); cout << "--------------------------------------------" << endl; return 0; }