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 #include using namespace std;

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!