Question: Write in java. The class Employee stores the name, employee id and salary per day for each employee. The program will display the employee name,
Write in java. The class Employee stores the name, employee id and salary per day for each employee. The program will display the employee name, id and the final salary.
The Employee class should consist of the following
1 - 'calSal()' which takes the salary, number of hours of work per day of employee as parameter 2 - 'AddSal()' which adds $10 to the salary of the employee if it is less than $50. 3 - 'AddWork()' which takes number of hours work per day and adds $5 to the salary of employee if the number of hours of work per day is more than 6 hours.
4 displayInfo() which returns the name , employees id and the final salary.
Create a parameterized constructor with a mutator method to assign the values to the attributes. The mutator can only be accessed by the class. Design the class accordingly based on the tasks of the methods above. Create the accessor methods.
Your TASK
Part 1
Write the Employee class Employee . Save the file as Employee.java.
Part 2
Create a client class ClientEmployee and save as ClientEmployee.java.
In the client class, do the following: -
You are required to declare 2 Employees. Get the input for name. staff id and salary. Display the information for each employee.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
