Question: C++: Using the class Date that you have defined in exercise O7, write the definition of the class named Employee with the following private data

C++: Using the class Date that you have defined in exercise O7, write the definition of the class named Employee with the following private data members:

first name - class string (the default first name is the null string )

last name - class string (the default last name is the null string )

ID number - integer (the default ID number is 999999)

birth day - class Date (the default birth day is the default date: 1/1/1960)

date hired - class Date (the default date of hire is 1/1/20011)

base pay - double precision (the default base pay is $0.00) In addition to the constructors, the class has the following public member functions:

void readPInfo( ) that reads the values for the data members first name, last name, ID number, birth day, and date of hire.

void readPayInfo( ) that reads the value for the base pay data member.

void printPInfo( ) that outputs the values of the data members first name, last name, ID number, birth day, and date of hire.

void setBpay( double newBpay ) that sets the value of the base pay to the new value, newBpay.

double getBpay( ) that returns the value of the base pay data member.

double getGpay( ) that returns the value of the gross pay (which is the base pay).

double computeTax( ) that computes the tax deduction on the gross pay and returns it as follows: I

f gross pay is greater than or equal to 1000, 20% of the gross pay;

If 800 <= gross pay < 1000, 18% of gross pay If 600 <= gross pay < 800, 15% of gross pay Otherwise, 10 % of the gross pay.

void printPayInfo( ) that outputs the gross pay, tax deduction, and net pay (gross pay - tax deduction).

Place the definition of this class in the header file Employee.h, and the definitions of the member functions in the source file Employee.cpp.

Note: - the header files string and Date.h must be included in the header file Employee.h and the header file Employee.h must be included in the source file Employee. cpp.

- The header file Employee.h must look like the following:

#ifndef EMPLOYEE_H

#define EMPLOYEE_H

#include using namespace std;

#include Date.h

Enter the class here

#endif

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!