Question
The code is done I just need this small modification. Create modified code to include a bonus for salaried employees, and place below along with
The code is done I just need this small modification.
Create modified code to include a bonus for salaried employees, and place below along with a snapshot of the output. [ Hint: bonuses are generally given to salaried employees; have the end - of - year bonus of one - half percent of the annual salary added to the annual salary ] .
#include
class Employee{ private: string name; int id; int hoursWorked;
public: Employee(){ this->name = ""; } Employee(string name,int id, int hoursworked){ this->name = name; this->id=id; this->hoursWorked=hoursworked; }
string getName(){ return name; } void setName(string name){ this->name = name; } void printdata(){ cout<<"ID Number "<<"\t"< class SalaryEmp : public Employee{ private: float salary; float hourlywage; public: SalaryEmp(string name, int id, int hoursworked,float salary, float hourlywage):Employee(name,id,hoursworked){ this->salary = salary; this->hourlywage=hourlywage; } float getSalary(){ return salary; } void setSalary(float salary){ this->salary = salary; } void print(){ cout<<"Employee Record"<<"\t"<<"Hourly Wage Employee"< } }; int main(){ SalaryEmp e = SalaryEmp("Sammy Student",805,38,38000.0,10.00);; e.print(); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started