Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 . Add the classes EmpleadoFijo and Project, in such a way that the following structure: Fixed Employee Class: The constructor receives as parameters the
Add the classes EmpleadoFijo and Project, in such a way that the
following structure:
Fixed Employee Class:
The constructor receives as parameters the name, id and base salary
The calculateSueldo method updates the salary attribute by removing of
taxes.
The printData method prints the name, salary and the message You are an employee.
company landlineNOTE: It does not print the ID
Project Class:
The print data method only displays the project name, number, and
of weeks and the NAME OF THE leading EMPLOYEE NOTE: Only print the name
of the employee, not the ID or the salary.
To check that these classes work, in the main file:
Generates a fixed employee type object with initial data, calculates his salary and
print your data on the screen
Generates a project type object assigning the previous employee as leader.
Prints project data on screen
Apply polymorphism in the calculateSalary and printData methods, so
so that the salary is calculated according to the data of each employee
Generate another object of type FixedEmployee, another of type ExternalEmployee and
another of type Project. Calculate the salaries of the two employees and Print the data of the
Project object
Generate an arrangement of employees permanent and two external Subsequently,
Through a cycle, it calculates your salary and prints your data. Remember that for this you must
use an Employee object structure and generate objects with the new operator.
Here is the initial code to complete.
#ifndefEXTERNALEMPLOYEEH
#defineEXTERNALEMPLOYEEH
#include
class ExternalEmployee : public Employee
public:
ExternalEmployee;
virtual ~ExternalEmployee;
ExternalEmployeestringint,int;
void setNumHoursint;
int getNumHours;
void calculateSalary;
void printData;
protected:
private:
int numHours;
;
#endif EXTERNALEMPLOYEEH
#include "ExternalEmployee.h
ExternalEmployee::ExternalEmployee
ctor
ExternalEmployee::ExternalEmployeestring aint b int c:Employeeab
numHoursc;
void ExternalEmployee::setNumHoursint x
numHoursx;
intExternalEmployee::getNumHours
return numHours;
void ExternalEmployee::calculateSalary
salarynumHours;
void ExternalEmployee::printData
cout"Employee
#include
using namespace std;
class Employee
public:
Employee;
virtual ~Employee;
Employeestringint;
void setNamestring;
string getName;
void setIdint;
int getId;
void calculateSalary;
void printData;
protected:
string name;
int id;
float salary;
private:
;
#endif EMPLOYEEH
#include "Employee.h
Employee::Employee
namesd;
id;
salary;
Employee::~Employee
dtor
Employee::Employeestring x int y
namex;
idy;
void Employee::setNamestring x
namex;
string Employee::getName
return name;
void Employee::setIdint x
idx;
int Employee::getId
return id;
void Employee::calculateSalary
salary;
void Employee::printData
cout"Employee number
#include "ExternalEmployee.h
using namespace std;
int main
cout"Activity submitted by :
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