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
Get step-by-step solutions from verified subject matter experts
