Hi there,
I was wondering if anyone can help me out here...This is what I have so far:
#include<iostream.h>
#include<conio.h>
class Employee
{
private:
int idNum;
char name[20];
double rate;
public:
Employee(const int id); //The Constructor with Arguments
Employee();//The Default Constructor
void displayValues();
};
Employee::Employee(const int id)
{
idNum = id;
cout<<"Enter the employee's last name";
cin>>name;
cout<<"What is the hourly rate for this employee?";
cin>>rate;
}
Employee::Employee()
{
idNum = 0;
cout<<"Enter the last namd of this contractual worker";
cin>>name;
cout<<"What is the fee for this contract?";
cin>>rate;
}
void Employee::displayValues()
{
cout<<"Employee "<<name<<" rate $"<<rate;
if(idNum == 0)
cout<<" for this contract"<<endl;
else
cout<<" per hour"<<endl;
}
Now, I'm suppose to include an additional function GetValues that will get the values for an employee from the user.
Include an additional member function to overload the assignment operator (=)
Include an additional member function to overload the addition operator (+)
//This operator will return an item of type employee whose idnum is 0 and
// Whose salary is the sum of the two employee salaries being added.
Include A Friend overload function to be able to cout an employee.
If anyone can help me with this, that would be great. I'll be working on it in the meantime....