make a payroll application that will have a group box titled Payroll Information. The group box will have textboxes and labels for the user to enter the following information: Employee ID, Employee Name, Hourly Rate, and Weekly Hours Worked. There will also be a Submit and Display button (see left side on example form below). On the opposite side of the form you will need a heading and 2 labels for each of the following: Employee ID, Employee Name, Hourly Rate, Weekly Hours Worked, Overtime Hours Worked, Overtime Pay, Gross Pay, Social Security, FICA, and Net Pay. (see right side on example form below) There should also be a functional button for Clear (clears textboxes and non-identifying labels) and Exit.You should include a class called Payroll that creates private variables for id, name, wage, hours worked, social security Tax, FicaTax, gross pay, net pay, overtime hours and overtime pay. You should also have a private constant for Social Security Tax Percentage set to 6.2% and Fica Tax Percentage set to 1.45%. Use a class constructor to set all the variable (not constants) values (except name and id) to 0.0. Create setters sub procedures and getters functions for each of the variable values. You will need a getter function for the 2 constants as well. Validation: Make sure only numbers can be put into the id field. Make sure only numbers and decimals can be put into the hours and rate fields. (You can use the Key Press event for this) Submit button will do all calculations. Calculations: Overtime Pay = If hours are greater than 40 then overtime pay will be hours over 40 X rate X 1.5. Gross Pay = Hours worked * rate + overtime pay Fica = Gross Pay * Fica Percentage (constant) Social Security = Gross Pay * Social Security Percentage (constant) Net Pay = Gross Pay – Fica – Social Security Set all decimal values to currency with 2 decimal
make a payroll application that will have a group box titled Payroll Information. The group box will have textboxes and labels for the user to enter the following information: Employee ID, Employee Name, Hourly Rate, and Weekly Hours Worked. There will also be a Submit and Display button (see left side on example form below).
On the opposite side of the form you will need a heading and 2 labels for each of the following: Employee ID, Employee Name, Hourly Rate, Weekly Hours Worked, Overtime Hours Worked, Overtime Pay, Gross Pay, Social Security, FICA, and Net Pay. (see right side on example form below)
There should also be a functional button for Clear (clears textboxes and non-identifying labels) and Exit.You should include a class called Payroll that creates private variables for id, name, wage, hours worked, social security Tax, FicaTax, gross pay, net pay, overtime hours and overtime pay. You should also have a private constant for Social Security Tax Percentage set to 6.2% and Fica Tax Percentage set to 1.45%. Use a class constructor to set all the variable (not constants) values (except name and id) to 0.0. Create setters sub procedures and getters functions for each of the variable values. You will need a getter function for the 2 constants as well.
Validation: Make sure only numbers can be put into the id field. Make sure only numbers and decimals can be put into the hours and rate fields. (You can use the Key Press event for this)
Submit button will do all calculations.
Calculations:
Overtime Pay = If hours are greater than 40 then overtime pay will be hours over 40 X rate X 1.5.
Gross Pay = Hours worked * rate + overtime pay
Fica = Gross Pay * Fica Percentage (constant)
Social Security = Gross Pay * Social Security Percentage (constant)
Net Pay = Gross Pay – Fica – Social Security
Set all decimal values to currency with 2 decimal places.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps