ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 11 Weeks Ago, 1 Day Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 03 May 2017 My Price 8.00

Write a program that will compute and print the federal

Write a program that will compute and print the federal, state, and local taxes for three employees of a company. and print out the company totals.

Example input:

First Name //Jim

Last Name //Jack

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

State tax withheld to date //2163.00

The calculations will be as followed:

1) Local tax is 1.15% of the first $45,000 earned

2) Federal tax withheld is computed by taking gross pay per period minus $15.00 for each dependent times 10* of yearly income projected to be between 0 and $20,00, 20% of yearly income projected 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 Jack's case this is $917.13-45 which is $872.13. This number was multiplied by 52 to give $45,350.13 which is projected yearly income upon which the currentFederalTax is based. The number is over $40,00 and puts Jim jack 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 Jack has made almost that since the local tax withheld to date is $515.01.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 Jack only needs to pay $2.50 which is the amount to bring him up to the maximum $517.00.

Using the above data, typical outputs for one employee will look like: (This is computed Correctly)

Employee: Jim Jack

Hours Worked: 55.50

Hourly Rate: $14.50

Gross Wages $917.13

Current Yr. To Date

Federal $261.64 $6271.64

State $112.12 $1233.33

Local $2.50 $517.50

Total Deductions $355.85

Net Pay $561.28

Output for the company report would look like this: //(These are not correct data)

 

The Company Name

Weekly Summary

 

Current Yr.To Date

Federal $313.43 $1678.66

State $112.12 $1233.33

Local $30.40 $322.33

 

Total Deductions $787.05 $8830.08

Gross Wages $3317.13

Net Pay $2830.08

 

THIS WILL HAVE AT LEAST 3 CLASSES. Create an employee class which will have methods and data related to a single employee. Keep in ming the requirements and keep all input and output in centralized methods that will easily be modified. Create a company class that will have data and methods associated with the company. Keep in ming the requirements and keep all input and output in centralized methods that will easily be modified. Create a demo class to demonstrate these classes. The demo program is similar to those in the text. Use the following main program.

import java.io*;

public class Demo

{

public static void main(Sting[] args)

{

Scanner scan=new Scanner(System.in);

Reporter clerk=new Reporter();

Employee person=new Employee();//one student

int numberOfEmployees,i,count;

System.out.println("Enter a number of employees");

numberOfEmployees= scan.nextInt();

for(i=0;i{

person.readInput();

person.calculateData();

person.writeOutput();

clerk.collectDataForReport(person);

}

clerk.printDataForCompanyReport();

}

}

public class OutPut //class that can be used to print one line for output

{

public static void printStringLeft (int size, String formatted)

//Blank fills and left justifies a string in a field or size characters

{

int length =formatted.length();

System.out.print(formated);

while (size > lenngth)

{

System.out.print(" ");

size --l

} //End while (size >length)

} //End function printString

public static void printStringRight( int size, String formatted)

// Blank fills and right justifies a string in a field of size characters

{

int length= formatted.length();

while (size >length)

{

System.out.print(" ");

size --;

} //End while(size > length)

System.out.print(formatted);

} //End function printString

// two ways to do money formatting

import java.text.DecimalFromat;

import java.text.NumberFormat;

public class MoneyFormatDemo

{

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);

 

Decimal Format dollarFormat = new DecimalFormat ("$#,###,###.00");

System.out.println(dollarFormat.format(34456.2));

money = dollarFormat.format(20043.44);

System.out.println(money);

}

}

 

 

the Calculate data method must have 4 private methods to:

1) calculate income tax

2) calculate federal tax

3) calculate local tax

4) calculate local tax

5) Getters and setters for the private data are necessary.

 

Also please go around this driver: 



public class OutPut {

// *************************************************************************
// Blank fills and left justifies a string in a field of size characters
// and returns string
public static String makeStringLeft(int size, String formatted) {
String answer = "";
int length = formatted.length();
answer = answer + formatted;
while (size > length) {
answer = answer + " ";
size--;
} // End while (size > length)
return answer;
}

public static void printStringLeft(int size, String formatted)
// Blank fills and left justifies a string in a field of size characters

{
int length = formatted.length();
System.out.print(formatted);
while (size > length) {
System.out.print(" ");
size--;

} // End while (size > length)

} // End function printString

// *************************************************************************
// Blank fills and right justifies a string in a field of size
// characters
// and returns string
public static String makeStringRight(int size, String formatted)
// Blank fills and right justifies a string in a field of size
// characters
{
String answer = "";
int length = formatted.length();
while (size > length) {
answer = answer + " ";
size--;
} // End while (size > length)
answer = answer + formatted;
return answer;
}

public static void printStringRight(int size, String formatted)
// Blank fills and right justifies a string in a field of size
// characters
{
int length = formatted.length();
while (size > length) {
System.out.print(" ");
size--;

} // End while (size > length)
System.out.print(formatted);
} // End function printString

// ***************************************************************************
}

Answers

(11)
Status NEW Posted 03 May 2017 07:05 AM My Price 8.00

-----------

Not Rated(0)