Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CLASS 1: Design a base class named Employee. The class should keep the following information in its data members: - Employee name (separate first and

CLASS 1: Design a base class named Employee. The class should keep the following information in its data members:

- Employee name (separate first and last names)

- Social Security Number, in the format xxx-xx-xxxx, where x is a digit within the range 0 through 9

- Employee number, in the format xxx-L, where x is a digit within the range 0 through 9, and the L is a letter within the range A through M.

- Add a constructor and other appropriate member functions to manipulate the class data members (get, set, and print).

- Input Validation: Only accept valid Social Security Numbers (with no alphabetic characters) and valid Employee Numbers (as described above).

- Display of Social Security Number should be masked to only show the last four numbers, (e.g. xxx-xx-1234)

Note: Input validation will be done in the setter functions and no input statements should be used i.e. return a methodStatus value indicating success or failure.

CLASS 2. Design a class named SalaryEmployeePay. This class should be derived from the Employee class. It should

store the following information in data members:

- Annual pay

- Weekly pay (to be calculated from annual pay)

- Tax rate code (1 = 25%, 2 = 20%, 3 = 15%)

Add a constructor and other appropriate member functions to manipulate the class data members.

Input Validation: Do not accept negative values for annual pay. Do not accept values outside the range of 1 to 3 for tax rate code.

CLASS 3. HourlyEmployee. This class should be derived from the Employee class. It should store the following

information in data members:

- Hourly pay rate

- Number of hours worked

Add a constructor and other appropriate member functions to manipulate the class data members.

Input Validation: Hourly pay rate cannot be less than $10.00 per hour or more than $75.00 per hour. Do not accept values over 60 for hours worked.

CLASS 4. HourlyEmployeePay. This class should be derived from the HourlyEmployee class. It should store the

following information in data members:

- Overtime pay rate (1.5 times hourly rate if over 40 hours, calculate from HourlyEmployee hourly pay rate)

- Tax rate code (1 = 25%, 2 = 20%, 3 = 15%)

- Work status (F = Full time, P = Part Time)

Add a constructor and other appropriate member functions to manipulate the class data members.

Input Validation: Do not accept values outside the range of 1 to 3 for tax rate code, F or P for work status.

CLASS 5. AgencyEmployeePay. This class should be derived from the HourlyEmployee class. It should store the following information in data members:

- Company to pay

Add a constructor and other appropriate member functions to manipulate the class data members.

Using the classes you created, write a testbed main program that asks for sample data for the various employee types. Then, for each type calculate the employees pay and display her/his pay information on the screen and to an output file pay.dat.

This program needs to be in C++ and the classes must be separated with separate header files

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

Step: 3

blur-text-image

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions

Question

5 Indicate three ways to deal with them.

Answered: 1 week ago