Breaking News

Please Help Community by G+

Employee Salary Calculator in Java using BigDecimal and Overloading Constructors


The employee class should contain overloaded constructors, one that accepts first and last names as well as annual salary, and one that accepts first and last names only.  The latter should reference the former via the "this" constructor reference.

Extra Credit: 

Use datatype BigDecimal for salary and tax amounts
(see (Links to an external site.))

So you should fix any error in your previous assignment, and include the variation described above.
The previous assignment description is repeated below:

Create a project which will accept information about employee pay and then display calculated results.  The project should contain at least your executable class with the main method, as well as an Employee class.

Your executable class should ask the user for the following information:

  • Employee First Name
  • Employee Last Name
  • Annual Salary


And it should allow the user to enter information about one or more taxes; tax rate(in %) and tax name.  It should continue to prompt the user for another tax until the user enters -1 for the tax rate.
Each tax rate and tax name should be passed to a method in the Employee class which will save the rates in an ArrayList.

After all the taxes have been entered, the main program should then display the employee name and the following information:

  • Annual gross pay (before taxes),
  • Total annual taxes,
  • Annual net pay (after taxes).
  • Biweekly gross pay (before taxes),
  • Total biweekly taxes,
  • Biweekly net pay (after taxes).

Note: biweekly means a 2 week period.

The First and Last names should be from 1 to 20 characters each. The salary and tax amounts should be checked so that only meaningful, reasonable values are accepted. The biweekly pay calculation and the tax calculations should all be done in the Employee class and there should be methods to return the results

Hassnain Jamil

Hassnain Jamil

No comments:

Post a Comment

Powered by Blogger.