Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions

Question

What are the determinants of cash cycle ? Explain

Answered: 1 week ago