JAVA PROGRAM Create a class EmployeeImp and do the following implement interface EmployeeInterface Define the following attributes: int count and an array variable of type Employee. Write a default constructor and initialize array Employee with the size defined in EmployeeInterface Write a constructor that accepts size of an array as parameter. Create array Employee with the parameter size. Use the diagram attached below as reference for the data members of each class. Note: No need to define interface EmployeeInterface, Employee, HourlyEmployee and CommisionEmployee public interface EmployeeInterface{ int size=20; public boolean add(Employee e); // add either an hourly employee or commission employee public int search(String name); //return the index if the name is existing in the array, if not existing return -1 public void display(); //display the information of the employee with its earnings. public boolean isFull(); //return 1 if array is full, 0 if not public boolean isEmpty(); // return 1 if array is empty, 0 if not public void displayCountEmployee(); //display the number of employee in hourly and commission public Employee delete(String name);// deletes the employee whose name is equal to parameter name }
JAVA
Create a class EmployeeImp and do the following
- implement interface EmployeeInterface
- Define the following attributes: int count and an array variable of type Employee.
- Write a default constructor and initialize array Employee with the size defined in EmployeeInterface
- Write a constructor that accepts size of an array as parameter. Create array Employee with the parameter size.
Use the diagram attached below as reference for the data members of each class.
Note: No need to define interface EmployeeInterface, Employee, HourlyEmployee and CommisionEmployee
public interface EmployeeInterface{
int size=20;
public boolean add(Employee e); // add either an hourly employee or commission employee
public int search(String name); //return the index if the name is existing in the array, if not existing return -1
public void display(); //display the information of the employee with its earnings.
public boolean isFull(); //return 1 if array is full, 0 if not
public boolean isEmpty(); // return 1 if array is empty, 0 if not
public void displayCountEmployee(); //display the number of employee in hourly and commission
public Employee delete(String name);// deletes the employee whose name is equal to parameter name
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps