Write all getter and setter methods which are required -


Create a class named Employee. An employee has fields for first name, middlename, last name, employee id, the number of hours an employee has worked in amonth, and the hourly pay rate.

Write a program that performs the following tasks:

1. Write all getter and setter methods which are required.

2. Write three constructors, the first constructor is a no-argument constructor.The second constructor accepts first name, middle name, and last name of the employee as arguments. The third constructor accepts all the fields for an employee as arguments and sets the corresponding values.

3. Create two overloaded methods to calculate gross pay. The first method accepts hourly pay rate and the number of hours that employee has worked as String types. The second method accepts these two arguments as doubletypes. Both of these methods print the employee first name, last name, and gross pay on the screen.

4. Assume that the tax rate applied to the employee income is 12%, write another method that calculates and prints employee income after tax.

5. Create different objects of the Employee (5 or more) and set different values for each employee instance. Write a method that checks whether twoemployees have the same first name, middle name, and last name and prints the result on the screen.

6. Write a method to check whether an employee is eligible for a specific type of loan: to be eligible, an employee must have a minimum of $3,000 income per month (after applying tax) and must have worked for at least 120 hours in a month.

7. Write another class containing main method and test all the methods in your Employee class.Format your output to two decimal places where needed. Use JOptionPane class to read inputs.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write all getter and setter methods which are required -
Reference No:- TGS02396902

Now Priced at $15 (50% Discount)

Recommended (90%)

Rated (4.3/5)