The information about a date consists of the month, the day, and the year(all integer values).

  • Define a structure type Date to represent this information.
  • Create a header file named Date.h to hold this structure, and save it in your CS240 directory.

The information about an employee consiss of his ID number (integer value), first name (a string), last name (a string), date of birth (a Date structure), date hired (a Date structure), the pay rate (a floating point value), and the number of hours of work during a week (integer value).

  • Define a structure type EmployeeInfo to represent this information.
  • Create a header file named EmployeeInfo.h to hold this structure, and save it in your CS240 directory: Note that the header file Date.h must be included in this file.

Create and save in your CS240 directory the file lab2.input that contains the information about 10 employees: use one line of input for each employee. For example:

58243 John Doe 10 25 1981 6 15 2005 8.85 36

Is for an employee with ID number 58243; firstname: john; last name: doe; date of birth 10/25/1981; date hired: 6/15/2005; pay rate $8.75; who has worked 36 hours in the week.

Write a program that does the following for each of the 10 employees:

  • reads the information about the employee
  • computes his/her gross pay: The gross pay is the pay rate times the number of hours of work.
  • computes his/her tax deduction as follows:
    • if gross pay is greater than or equal to 1000, then the tax deduction is 25% of the gross pay.
    • otherwise, the tax deduction is 18% of the gross pay.
  • computes his/her net pay(gross pay minus the tax deduction).
  • Output the information about the employee: the output should look as follows: (leave at least two blank lines between two employees).
Doe, John
ID: 12345
DOB: 10/25/1989
DOH: 7/14/2007
Hours: 36
Pay Rate: $15.50
Gross Pay: $558.00
Tax: $100.44
Net Pay: $457.56

Your program should also compute the total gross pay and the total tax deduction of the company and print them. Note that you must include the header EmployeeInfo.h in your source file, but not Date.h.

Compile, link and execute your program in the UNIX computer using I/O redirection.

Return the source file, the two header files, the input file, and the output file in this order.

Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.