Code:
#include <iostream>
#include <iomanip>
using namespace std;
class Employee
{
private:
double id;
double pay;
double hours;
public:
Employee (double = 0.0, double = 0.0, double = 0.0);
void showEmp();
void setNewEmp(double,double,double);
};
Employee::Employee(double i,double p, double h)
{
id = i;
pay = p;
hours = h;
}
void Employee::showEmp()
{
cout << " Employee ID = " << id <<
"\n Pay = " << pay << "\n Max. Hours = "<< hours << endl;
}
void Employee::setNewEmp(double i, double p, double h)
{
id = val[0][1];
pay = val[0][2];
hours = val[0][3];
}
int main()
{
const int r=3;
const int c=3;
Employee info(0,0,0);
float val[r][c];
double a, b,d,e,f,g;
for(a=0; a<r;)
{
cout<<"1. Add an employee"<<endl;
cout<<"2. Modify employee data"<<endl;
cout<<"3. Delete an employee"<<endl;
cout<<"4. Exit this menu"<<endl;
cin>>d;
if(d==1)
{
cout<< "Type in employees id number, pay, and maximum hours:"<<endl;
cin>> b>>e>>f;
info.setNewEmp(b,e,f);
info.showEmp();
}
else if(d==2)
{
cout<<"Which employee information do you wat to modify."<<endl;
}
else if(d==3)
{
cout<<"Which employee do yo want to delete"<<endl;
}
else
{
}
}
return 0;
}