// Project 4 : Employee Database Part 4 // Programmer : Sean Smith // Class : CSC215 // Professor : Phill Miller // Driver.cpp #include "Employee.h" #include #include #include using namespace std; using namespace Human; int main() { // [OUTPUT HEADER] ====================================================================== cout << "============+--------------------------------+============" << endl; cout << "============| Employee Database |============" << endl; cout << "============| Programmer : Sean Smith |============" << endl; cout << "============| Class : CSC215 |============" << endl; cout << "============| Professor : Pill Miller |============" << endl; cout << "============+--------------------------------+============\n" << endl; cout << "<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>" << endl; cout << "><><><><><><[ Employee Info ]><><><><><><" << endl; cout << "<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n" << endl; // [EMPLOYEE OBJECT] =================================================================== Employee* employeeArray[10]; // [INPUT LOOP] ========================================================================= for(int counter = 0; counter < 3; counter++) { // [VARIABLES] ====================================================================== string newName1, newName2, newJob1, newJob2; float newWage; float newHours; float newPay; // Setting up Employee Info cout << "-------------[Employee #" << counter+1 << "]-------------" << endl; // [NAME INPUT] ===================================================================== cout << "Enter Name : "; do { cin >> newName1; if(newName2.length() > 0) { newName2.append(" "); } newName2.append(newName1); } while(cin.peek() == ' '); // [JOB INPUT] ====================================================================== cout << "Enter Job Title : "; do { cin >> newJob1; if(newJob2.length() > 0) { newJob2.append(" "); } newJob2.append(newJob1); } while(cin.peek() == ' '); // [WAGE INPUT] ===================================================================== cout << "Enter Hourly Wage : "; cin >> newWage; // [HOURS INPUT] ==================================================================== cout << "Enter Hours Worked : "; cin >> newHours; // [PAY CALCULATION] ================================================================ newPay = employeeArray[counter]->CalculatePay(newWage, newHours); // [EMPLOYEE OBJECTS] =============================================================== employeeArray[counter] = new Employee(newName2.c_str(), newJob2.c_str(), newWage, newHours, newPay); } cout << "\n<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>" << endl; cout << "><><><><><><[ Employee Pay ]><><><><><><" << endl; cout << "<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n" << endl; // [OUTPUT LOOP] ======================================================================= for (int counter = 0; counter < 3; counter++) { // Output Employee Information and Pay cout << "-------------[Employee #" << counter+1 << "]-------------" << endl; cout << "Employee Name : " << employeeArray[counter]->GetName(); // Putting '*' Next to Highly Paid Employees if (employeeArray[counter]->IsHighlyPaid(employeeArray[counter]->GetWage(), employeeArray[counter]->GetPay())) { cout << "*" ; } cout << endl; cout << "Employee Job Title : " << employeeArray[counter]->GetJob() << endl; cout << "Employee Pay : " << employeeArray[counter]->GetPay() << endl; } cout << "\n<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>" << endl; cout << "><><><><><><[ Fin ]><><><><><><" << endl; cout << "<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n" << endl; return 0; }