Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++: Using the class Date that you have defined in exercise O7, write the defini

ID: 3815262 • Letter: C

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 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:

If 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 <string>
using namespace std;
#include “Date.h”
Enter the class here
#endif

Explanation / Answer

class Employee
{
public:
Employee();
int salary;
};
Employee::Employee() { salary = 05; }

int main()
{
Employee joe;
std::cout << "Joe Salary: " << joe.salary << std::endl;
joe.salary = 10;
std::cout << "Joe New Salary: " << joe.salary << std::endl;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote