Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java please At this point in your life most of you have or have had a job. One of the aspects of a job is
Java please
At this point in your life most of you have or have had a job. One of the aspects of a job is dealing with taxes. Benjamin Franklin said in this world nothing can be said to be certain, except death and taxes. There are many types of taxes. Some of the most familiar taxes are state sales tax, federal and state income tax and local property tax. Write a program that will compute and print the federal, state, and local taxes for three workers of the ABC Company and print out the company totals.
Example input:
First name// Jim
Last name// Jackson
Number of dependents // 3
Hourly rate// 14.50
Number of hours worked// 55.50
Local tax withheld to date// 515.00
Federal tax withheld to date// 6010.00
Sate tax withheld to date// 2163.00
The calculations will be as follows:
1) Local tax is 1.15% of the first $45,000 earned.
2) Federal tax withheld is computed by taking gross pay per pay period minus $15.00 for each dependent times 10% of yearly income projected to be between 0 and $20,000, 20% of yearly income projected to be between $20,000 and $40,000, and 30% on yearly income projected to be over $40,000.
3) State tax withheld is 5% of projected income between 0 and $30, 000, and 10% over $30,000.
4) Over-time is computed as time-and-a-half over 40 hours per week.
5) GrossWages: the employee gets time and a half for hours worked over 40.
6) CurrentFederalTax starts with the GrossWages minus the number of dependence times $15.00. In Jim Jacksons case this is $917.13 45 which is $872.13. This number is multiplied by 52 to give $45,350.13 which is the projected yearly income upon which the CurrentFederalTax is based. This number is over $40,000 and puts Jim Jackson in the 30% bracket. We multiply $872.13 by 30% to give us the CurrentFederalTax of $261.64.
7) The maximum local tax is $517.50 which is 1.15% of $45,000. The input indicates that Jim Jackson has made almost that since the local tax withheld to date is $515.00. 1.15% of $917.13 is $10.54. Since the sum of $515.00 and $10.54 is greater than the maximum of $517.50, Jim Jackson only needs to pay $2.50 which is the amount to bring him up to the maximum $517.50.
Using the above data, typical outputs for one employee will look like: (this is computed accurately)
Worker:Tom Smith
One week:55.50
Amount per hour:$14.50
Total for one week$917.13
CurrentYr. To Date
Federal$261.64$6271.64
State$91.71$2254.71
Local$2.50$517.50
Total Deductions$355.85
Net Pay$561.28
Output for the employer report would look like this: // (these are not correct data)
The ABCD Company
Weekly summery
CurrentYr. To Date
Federal$5,313.43$78,1678.66
State$1,112.12$41,233.33
Local$230.40$7,322.33
Total Deductions$2,787.05$134,830.08
Gross Wages$134,317.13
Net Pay$72,830.08
Project 3 will have at least three classes. Create a worker class which will have methods and data related to a single worker. Keep in mind the requirements for project 5. Keep all input and output in centralized methods that can be easily modified. Create an Employer class that will have data and methods associated with the employer. Again, keep in mind the requirements for project 6. Keep all input and output in separate methods that can be easily modified. Using the examples below as your guide, print the answer numbers with dollar signs. You must use the following demo program.
import java.util.Scanner;
public class WorkerDemo
{
static Scanner scan = new Scanner(System.in);
public static void main(String[] args)
{
Employer clerk = new Employer ( );
Worker worker;
int count;
System.out.println("Enter number of employees:");
int numberOfWorkers = scan.nextInt();
for (count = 1; count <= numberOfWorkers; count++)
{
worker = new Worker ();
System.out.println("Enter data for worker number " + count);
worker.readInput();
worker.calculateData();
worker.writeOutput( );
clerk.colectDataForEmployerReport(employee);
}
clerk.printDataForEmployerReport();
}
} the calculateData() method must have 4 private methods to:
// 1) calculate income
// 2) calculate federal tax
// 3) calculate state tax
// 4) calculate local tax
// Getters and Setters for the private data are necessary. Eclipse will
// create them for you. Place your mouse where you would like them
// (Usually at the bottom of the class). Right click, choose Source,
// choose Generate Getters and Setters. Choose the private variables you
// want. (all of them).
public class OutPut // On my website is class OutPut that can be used to print one line of output. There are
two static methods that can be used to print a string left or right justified in a space of
characters and two static methods that will return a string left or right justified in a space of characters.
See my website.
// two ways to do money formatting
import java.text.DecimalFormat;
import java.text.NumberFormat;
public class MoenyFormatDemo
{
public static void main(String[] args)
{
NumberFormat moneyFormatter = NumberFormat.getCurrencyInstance();
System.out.println(moneyFormatter.format(2003.4));
String money = moneyFormatter.format(20043.44);
System.out.println(money);
DecimalFormat dollarFormat = new DecimalFormat("$#,###,###.00");
System.out.println(dollarFormat.format(34456.2));
money = dollarFormat.format(20043.44);
System.out.println(money);
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started