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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started