// Project 3 : Employee Database Part 3 // Programmer : Sean Smith // Class : CSC215 // Professor : Phill Miller #include "Project3H1.h" #include "Project3H2.h" using namespace employeeNamespace; using namespace employeePayNamespace; int main() { // Outputing 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; // Declaring Employee & EmployeePay Objects Employee* employeeArray[10]; EmployeePay* employeePayObject = new EmployeePay(); // Declaring Counter int counter; for(int counter = 0; counter < 3; counter++) { // Setting up Employee Info cout << "-------------[Employee #" << counter+1 << "]-------------" << endl; // Declaring Variables string tempName1, tempName2, tempJobTitle1, tempJobTitle2; float tempWage, tempHours; // Aquiring Employee Name cout << "Enter Name : "; do { cin >> tempName1; if(tempName2.length() > 0) { tempName2.append(" "); } tempName2.append(tempName1); } while(cin.peek() == ' '); // Aquiring Employee Job Title cout << "Enter Job Title : "; do { cin >> tempJobTitle1; if(tempJobTitle2.length() > 0) { tempJobTitle2.append(" "); } tempJobTitle2.append(tempJobTitle1); } while(cin.peek() == ' '); // Aquiring Employee Hourly Wage cout << "Enter Hourly Wage : "; cin >> tempWage; // Aquiring Employee Hours cout << "Enter Hours Worked : "; cin >> tempHours; // Calling CalulatePay Function employeePayObject->CalculatePay(tempWage, tempHours); // Creating Employee Objects employeeArray[counter] = new Employee(tempName2, tempJobTitle2, tempWage, tempHours); } cout << "\n<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>" << endl; cout << "><><><><><><[ Employee Pay ]><><><><><><" << endl; cout << "<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n" << endl; for (counter = 0; counter < 3; counter++) { // Output Employee Information and Pay cout << "-------------[Employee #" << counter+1 << "]-------------" << endl; cout << "Employee Name : " << employeeArray[counter]->GetEmployeeName(); // Putting '*' Next to Highly Paid Employees if (employeePayObject->IsHighlyPaid(employeeArray[counter]->GetEmployeeWage(), employeePayObject->CalculatePay(employeeArray[counter]->GetEmployeeWage(), employeeArray[counter]->GetEmployeeHours()))) { cout << "*" ; } cout << endl; cout << "Employee Job Title : " << employeeArray[counter]->GetEmployeeJobTitle() << endl; cout << "Employee Pay : " << employeePayObject->CalculatePay(employeeArray[counter]->GetEmployeeWage(), employeeArray[counter]->GetEmployeeHours()) << endl; } cout << "\n<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>" << endl; cout << "><><><><><><[ Fin ]><><><><><><" << endl; cout << "<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n" << endl; return 0; }