Question: Write a java eclipse program that will implement an Employee class. The class should have three member variables called name, hoursWorked, and hourlyRate. The class

Write a java eclipse program that will implement an Employee class. The class should have three member variables called name, hoursWorked, and hourlyRate.

The class should exhibit data hiding.

Write get and set methods for each member variable.

Write a constructor to initialize all member variables.

Write a method called GetPay that returns the pay that the employee should make. An employees pay is the hours worked times the hourly rate.

You should declare two instance of the Employee class inside main() and initialize them with different data (use constructor).

Print name and pay for each employee (hint: use printf)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!