// F.T. Liu // Comp 1672 demo program // small test program for our employee class #include #include "employee.h" using namespace std; int main() { Employee Joe("Joe", "Smith", 10); Employee Jane("Jane", "Jones", 12); Employee newEmployee1; Employee *newEmployee2; char fn[100], ln[100]; float w; cout << "Current Employees: " << endl; Joe.display(); cout << endl; Jane.display(); cout << endl; cout << "Enter data for the new employee: "; cin >> fn >> ln >> w; newEmployee1.firstname(fn); newEmployee1.lastname(ln); newEmployee1.wage(w); cout << "New employee: (Using display function)" << endl; newEmployee1.display(); cout << endl; cout << "New employee: (Using accessor functions)" << endl; cout << newEmployee1.firstname() << " " << newEmployee1.lastname() << ": " << newEmployee1.wage() << endl; // testing the copy constructor: newEmployee2 = new Employee(newEmployee1); cout << "Copying the new employee using the copy constructor: " << endl; newEmployee2->display(); cout << endl; cout << "Copying using the assignment operator: " << endl; *newEmployee2 = Joe; newEmployee2->display(); cout << endl; cout << "Another output test: " << endl; cout << newEmployee2->firstname() << " " << newEmployee2->lastname() << ": " << newEmployee2->wage() << endl; return 0; }