Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help me please use c++ and show your output Base class Employee The Employee class below is the parent class. You can add an

please help me

please use c++ and show your output

Base class Employee

The Employee class below is the parent class. You can add an arg-constructor to the Employee class if needed but do not change the provided code. An employee's net pay is calculated biweekly according to the additional attributes. You will define two child classes, HourlyEmployee and SalariedEmployee.

class Employee {

private:

string code; "S" for Salaried Employee, "H" for Hourly Employee

string ssn;

string first;

string last;

string department;

string role;

double netPay;

static int count;

public:

Employee(); //constructor

~Employee();

string getCode() const;

void setCode(string);

string getSSN() const;

void setSSN(string);

string getFirst()const;

void setFirst(string);

string getLast() const;

void setLast(string);

string getDept() const;

void setDept(string);

string getRole() const;

void setRole(string);

double getNetPay() const;

void setNetPay(double);

void display();

static int getEmpCount();

};

#endif

Child Classes : HourlyEmployee and SalariedEmployee

The HourlyEmployee class has two additional attributes, payRate as double and workHours as int, whereas the SalariedEmployee class has only one additional attribute, biweeklySalary. Since the net pay of an employee is calculated biweekly, the net pay of a salaried employee will be the same as biweeklySalary.

Testing the classes

By utilizing the provided employee.txt, build an array of hourly employees in the heap and an array of salaried employees in the stack. Both arrays have the size of 3. Your program is required to display the following.

R1: The sequence of constructor calls

R2: The information of all the employees that includes net pays but not pay rate nor work hours.

R3: Changes in employee count

R4: The sequence of destructor call

employee.txt

H 135-25-1234 Sophia Smith DevOps Developer 35.50 40 S 135-67-5462 Jacob Johnaon SecOps Pentester 130000 S 252-34-6728 Emma William DevOps DBExpert 100000 S 237-12-1289 Mason Miller DevOps CloudArchitect 80000 H 581-23-4536 Jayden Jones SecOps Pentester 60 20 S 501-56-9724 Mia Rogers DevOps Auditor 90000 S 408-67-8234 Choloe Cook DevOps QAEngineer 100000 S 516-34-6524 Daniel Morris DevOps ProductOwner 300000 H 526-47-2435 Natalie Smith DevOps Developer 40 25 S 530-46-8245 Grace Johnson SecOps SecurityEngineer 300000 S 035-35-6472 Avery Allen DevOps TechnicalLead 250000 S 222-35-9324 Joshua Youn DevOps ScrumMaster 150000 S 407-36-1285 Elijah Hall DevOps QAEngineer 100000 S 251-98-2836 Davia Wright Devops CloudArchitect 200000 S 627-67-9879 Andrew Rogers Devops SystemAdmin 100000 S 509-45-0909 Joshua Park SecOps SecurityArchitect 250000 S 408-12-8976 Stewart Thomson DevOps DeploymentEngineer 250000 S 425-90-2010 Sanjeev Sharma DevOps WorldwideLead 350000 S 433-44-2324 Sandra Sellters AccountFinance AccountingManager 200000 S 486-88-9981 Dennis Arthur AccountFinance Accountant 60000 S 478-77-2763 Daniel Weaver Sales SalesManager 70000 S 505-55-8786 Amanda Byron Sales SalesAssociate 70000 S 429-30-3678 Megan Finley Administration OfficeManager 80000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions