Question: Stack List for Payroll records a) Add a Java Project StackPayRollProject to assign the instance data of all records read from the input file PayRoll.in
Stack List for Payroll records
a) Add a Java Project StackPayRollProject to assign the instance data of all records read from the input file PayRoll.in into a stack List to print records in the descending order with respect to the amount of employee Net Amount Pay using the method CalculateNetAmountPay (). You should use user-defined method push() implemented in the class.
b) Add a class to define data structure type, called Payroll, which is designed to group data and functions into a single unit that represents a template of the fields used in PayRoll.in as shown in the following Figure.
c) Each line within PayRoll.in represents a payroll's record stored in salary net amount ascending order with the following fields: employee_id (int), employee_name (string), employee_ssn (string), employee_work_hours (double), employee_hour_rate (double).
d) Add default constructor (employee_id=0, employee_name="", employee_ssn="", employee_work_hours=0, employee_hour_rate=0) and constructor with parameters within Payroll class in order to initialize the data members (employee_id, employee_name, employee_ssn, employee_work_hours, employee_hour_rate) of every object.
e) Add a method within PayRoll class called (CalculateNetAmountPay()) that calculates and returns the salary net amount taking into account the different deduction amounts described below.
1) Total_Income = employee_work_hours * employee_hour_rate
2) Deductions:
Provincial tax (Prv_Tax): 9% of Total_income.
Federal tax (Fed_Tax): 7% of Total_income.
Que. parental insurance. plan (QP_Ins): 0.55% of Total_income.
Employment insurance (E_ins): 1.4% of Total_income.
(Quebec pension plan) Qpp : 4.5% of Total_income.
Union dues (Union_d): 1.65% of Total_income.
3) The total Net Amount (Net_Amount) is calculated according to the following formula: Net_Amount = Total_Income - Deductions

payroll.in
116Ali123-654-7893222.00 111Robert123-456-7897822.00 122Anais321-654-7895632.00 114James321-654-9878025.50 125Peter312-654-7988225.50 119Sarah321-654-7989025.50
PayRoll.java PayRollN 1 116 Ali 123-654-789 32 28 } 2 111 Robert 123-456-789 3 122 Anais Console X @ Javadoc TestStackPayRollProj 4 114 James 5 125 Peter 6 119 Sarah 22.00 78 22.00 321-654-789 56 32.00 321-654-987 80 25.50 312-654-798 82 25.50 321-654-798 90 25.50 The EmployePay Information is: 119//Sarah//321-654-798//90.0//25.5 -> Pay Net Amount: 1,741.91$ The EmployePay Information is: 125//Peter//312-654-798//82.0//25.5 -> Pay Net Amount: 1,587.07$ The EmployePay Information is: 114//James//321-654-987//80.0//25.5 -> Pay Net Amount: 1,548.36$ The EmployePay Information is: 122//Anais//321-654-789//56.0//32.0 -> Pay Net Amount: 1,360.13$ The EmployePay Information is: 111//Robert//123-456-789//78.0//22.0 -> Pay Net Amount: 1,302.44$ The EmployePay Information is: 116//Ali//123-654-789//32.0//22.0 -> Pay Net Amount: 534.34$ The size of stack is:6 StackTop is: The EmployePay Information is: 119//Sarah//321-654-798//90.0//25.5 Pay Net Amount: 1 741 91$
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
