top of page
CIS 247C: Program Code
/*********CLASS BENEFIT*********/
class Benefit
{
private:
string healthInsurance;
double lifeInsurance;
int vacation;
public:
Benefit()
{
this->healthInsurance = "Not Given";
this->lifeInsurance = 0;
this->vacation = 14;
}
Benefit(string healthInsurance, double lifeInsurance, int vacation)
{
this->healthInsurance = healthInsurance;
this->lifeInsurance = lifeInsurance;
this->vacation = vacation;
}
Benefit(Benefit &mybenefit)
{
this->healthInsurance = mybenefit.healthInsurance;
this->lifeInsurance = mybenefit.lifeInsurance;
this->vacation = mybenefit.vacation;
}
void displayBenefits()
{
cout<<"\nBenefit Information\n";
cout<<"____________________________________________________________\n"; cout<<"Health Insurance:\t" << healthInsurance << "\n";
cout<<"Life Insurance:\t\t" << lifeInsurance << "\n";
cout<<"Vacation:\t\t" << vacation << " days\n";
}
string getHealthInsurance()
{
return healthInsurance;
}
void setHealthInsurance(string healthInsurance)
{
this->healthInsurance = healthInsurance;
}
double getLifeInsurance()
{
return lifeInsurance;
}
void setLifeInsurance(double lifeInsurance)
{
this->lifeInsurance = lifeInsurance;
}
int getVacation()
{
return vacation;
}
void setVacation(int vacation)
{
this->vacation = vacation;
}
};
bottom of page