// Project 1 : Employee Database // Programmer : Sean Smith // Class : CSC215 // Professor : Phill Miller #include #include #include using namespace std; double GetPay(double hours, double wage) { return (hours*wage); } // Initialize Code int main() { // Declaring Variables and Arrays double hourWageArray[10]; double hourWorkedArray[10]; double payArray[10]; string nameArray[10]; string jobTitleArray[10]; string nameTemp; string jobTitleTemp; bool isHighlyPaid = 0; // 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; // Starting Employee Information Loop for (int a = 0; a < 10; a++) { // Getting Employee Information cout << "-------------[Employee #" << a+1 << "]-------------" << endl; cout << "Enter Name : "; // Aquiring Employee Name do { cin >> nameTemp; nameArray[a].append(nameTemp.insert(0, " ")); } while(cin.peek() == ' '); cout << "Enter Job Title : "; // Aquiring Employee Job Title do { cin >> jobTitleTemp; jobTitleArray[a].append(jobTitleTemp.insert(0, " ")); } while(cin.peek() == ' '); // Aquiring Employee Hourly Wage cout << "Enter Hourly Wage : "; cin >> hourWageArray[a]; // Boolean check for 'Highly Paid' if (hourWageArray[a] >= 20) { isHighlyPaid = 1; } // Aquiring Employee Hourly Wage cout << "Enter Hours Worked : "; cin >> hourWorkedArray[a]; // Calculating Employee Pay payArray[a] = hourWageArray[a]*hourWorkedArray[a]; // Boolean check for 'Highly Paid' if (payArray[a] >= 800) { isHighlyPaid = 1; } // Attach '*' to 'Highly Paid' Employees if (isHighlyPaid) { nameArray[a].append("*"); isHighlyPaid = 0; } } cout << "\n<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>" << endl; cout << "><><><><><><[ Employee Pay ]><><><><><><" << endl; cout << "<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n" << endl; // Starting Employee Pay Loop for (int a = 0; a < 10; a++) { // Output Employee Information and Pay cout << "-------------[Employee #" << a+1 << "]-------------" << endl; cout << "Employee Name : " << nameArray[a] << endl; cout << "Employee Job Title : " << jobTitleArray[a] << endl; cout << "Employee Pay : " << payArray[a] << endl; } cout << "\n<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>" << endl; cout << "><><><><><><[ Fin ]><><><><><><" << endl; cout << "<><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n" << endl; return 0; }