Lab 6.1 Taxes
Background
There are many absolutes in life, one of which is taxes. In this lesson we study the tax deductions required to print a payroll check. The first tier of the federal income tax rate is about 12% and FICA is an abbreviation for Social Security Tax. The latest calculations show that the average American worker toils for the government for about 5 out of the 12 months of the year.
Assignment
- Write a program that calculates, stores, and prints tax info about one person. The constructor will take the hours worked and the hourly rate paid. You are not required to line up the decimal points in your output. Note: “Gross Pay” means income before tax is deducted, and “Net Pay” means income after tax is deducted. Here is an example output:
Hours worked: 30.0
Hourly rate: 16.35
Gross pay: 490.5
Federal Tax (12.4%): 60.822
FICA Tax (7.75%): 38.01375
State Tax (9.3%): 45.6165
Net pay: 346.04775
- Your program may give a slightly different net pay answer due to rounding off issues. Do not worry about this difference.
- Use final values to store the tax rates in your program.
Details
- Please do not hard-code the tax percentages.
- Instead, use the final keyword to make constants for tax rates and use these constants rather than writing numbers (this includes when printing).
- If you change the value of a tax rate, the output should change accordingly without you having to change it in more than one place.
- Make sure all final variables are CAPITALIZED_WITH_UNDERSCORES_BETWEEN_WORDS
- The constructor will take the hours worked and the hourly rate paid
- The structure of the program is up to you - but you should separate the Taxes class from the Driver.
- Among your Taxes methods, include getters, setters, and a printTaxes method.
- The only public method that should print output is printTaxes().
- Consider which access modifier is appropriate for each field and method. Other classes should only be able to change the values of fields via methods.
- Your Taxes class should never print the wrong values no matter what you do in the Driver.
Filenames
- Name your taxes class in the format PX_LastName_FirstName_Taxes
- Name your driver class in the format PX_LastName_FirstName_TaxesDriver
You must Sign In to submit to this assignment