1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
#include <cstdlib>
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main(int argc, char *argv[])
{
int iOption;
int iEmployeeID;
char input;
char cnt = 'y';
struct Employee_data {
string sName;
int iID;
float fSalary;
string sDOB;
string sDOH;
} Employee1, Employee2, Employee3, Employee4, Employee5;
cout << "Welcome to employee database. Please choose from following options." << endl
<< endl;
cout << "1. List employee information." << endl
<< "2. Add employee information." << endl
<< "3. Delete employee information." << endl
<< "4. Edit employee information." << endl
<< "5. Save changes and exit." << endl
<< endl << "Selection: ";
cin >> iOption;
switch(iOption) {
case 1:
{
cout << endl <<"You chose option 1, please enter ID# of Employee you would like to review." << endl
<< "Selection: ";
cin >> iEmployeeID;
break;
}
case 2:
{
cout << "You chose option 2, please enter ID# of Employee you would like to add." << endl
<< endl << "ID#: ";
cin >> Employee1.iID;
cout << "Now enter name of employee" << endl << "Name: ";
cin >> Employee1.sName;
cout << "Now enter employee salary in decimal form" << endl
<< endl << "Salary: ";
cin >> Employee1.fSalary;
cout << "Now enter employee date of hire." << endl
<< endl << "DOH: ";
cin >> Employee1.sDOH;
cout << "Now enter employee date of birth." << endl
<< endl << "DOB: ";
cin >> Employee1.sDOB;
cout << endl << endl
<< "You have entered..." <<endl<< endl
<< "ID#: " << Employee1.iID << endl
<< "Name: " << Employee1.sName << endl
<< "Salary: " << Employee1.fSalary << endl
<< "DOH: " << Employee1.sDOH << endl
<< "DOB: " << Employee1.sDOB << endl;
cout << "Return to main menu? y/n: ";
cin >> input;
break;
}
case 3:
{
cout << "You chose option 3, please enter ID# of Employee you would like to delete." << endl
<< endl << "ID#: ";
cin >> iEmployeeID;
break;
}
case 4:
{
cout << "You chose option 4, please enter ID# of Employee you would like to edit." << endl
<< endl << "ID#: ";
cin >> iEmployeeID;
break;
}
}
// 1 list employee information. employee information includes. name, date of hire, date of birth
// salary, employee id number.
// delete employee information.
// add employee information, take in name, date of hire, date of birth, salary, employee id number
// store for later retrieval
system("PAUSE");
return EXIT_SUCCESS;
}
|