I am having trouble getting the second constructor right for the class i created called employee. At the bottom i included where i call the function in int main
().
void printEmp()
{
cout<<"Employee: ";
for (int x=0;x<26;x++)
{
cout<<name[x];
}
cout<<"ID: "<<idNum;
cout<<"Salary: "<<salary;
};
void increaseSalary( double more)
{
if (more>0)
{
salary=salary+more;
}
else
{
cout<<"Error: the salary cannot be increased";
}
};
void setIDnum( int newIDnum)
{
if (newIDnum<1000||newIDnum>9999999)
{
cout<<"Error: the new identification number is invalid. It will be ste to 1000";
idNum=1000;
}
else
{
idNum=newIDnum;
}
};
void setSalary( double newSalary)
{
if(newSalary<=0)
{
cout<<"Error: the passed in salary is invalid. The salary will be set to 0.00";
salary=0.00;
}
else
{
salary=newSalary;
}
};