Starting from:

$25

ITSE2321- Program 12 Solved

The owners of the Annan Supermarket would like to have a program that computes the monthly gross pay of their non-exempt hourly employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the month, by the week. Assume there are 4 week in a month.  In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any hours over 40, are paid at 1.5 the regular hourly rate.  Net pay is gross pay minus taxes (Refer to the tax table on the second page). Use Class Scanner to input the user’s data.

 

Define a class called HourlyEmployee that extends the Employee Class provided. The class must have private attributes regular (≤ 40) and overtime hours worked.  The class must also have member functions to perform the following tasks:

 

•       A constructor to initialize the first name, last name, pay rate, and hours worked (See the Employee Class for more details).

 

•       A setter method to set

⬧ the hours work for the month (by the week – assume 4 weeks in a month)

 

•       A getter method to return

⬧ the total regular hours work for the month

⬧ the total overtime hours for the month

 

•       A getter method to return

⬧ the monthly regular pay

 

•       A getter method to return

⬧ the monthly overtime pay

 

•       A method that uses the super class’ toString method to display the output which must include the following information: ⬧ Employee's first and last name

⬧ Pay rate

⬧ Total hours worked

⬧ Total regular hours worked

⬧ Total overtime hours worked

⬧ Monthly Regular Pay

⬧ Monthly overtime pay

⬧ Monthly gross pay

⬧ Monthly taxes

⬧ Monthly net pay

 

Write a test Class named HourlyEmployeeTest to test the methods in the Employee and HourlyEmployee Class.  Allow the user to run the program as many times as possible.  

No input, processing, or output should happen in the main method.  All work in the test class should be delegated to other non-static methods in the class. Include the recommended minimum documentation for each method.  See the program one template for more details.

 

Study the Employee Class and understand it before starting the program.

 

 

 

 

Tax Table

 

                 If the gross 

Bracket          pay is over          But not over          Tax

 

1                                   $0.00           $2,000.00             10%

2                                   $2,000.00           $3,500.00             15%

3                                   $3,500.00           $6,000.00             28% 

4                                   $6,000.00          $10,000.00             31% 

5                                   $10,000.00              N/A                36%

 

 

 

 

Test your program with the following data:

 

Run 1                                                                           Run 2
 

Name:               John Doe                                           Name:               Jane Doe

Hourly rate:       $35.10                                               Hourly rate:       $37.20

Hours worked:   40, 30, 40, 35                                   Hours worked:  40, 40, 40, 40

 

 

Run 3
 

Name:                <Your Name (First Last)

Hourly rate:        $65.50  

Hours worked:   50, 35, 40, 55 

 

 

Run your program and copy and paste the output to a file.  Create a folder named, fullname_program12.  Copy your source code and the output file to the folder.  Zip the folder and upload it to Blackboard.

More products