Write a java program to create a class Employee which contains member variables as name (String object) empid (Integer object) salary (Float object) age (Integer object) Define a default as well as a parameterized constructor to initialize member variables with default and specified values respectively. Define and overload a method search as defined below boolean search (Employee e[ ], String name) To search an employee with name in an array of employee objects, if found return true, else false. boolean search (Employee e[ ], Integer empid) To search an employee with the empid in an array of employee objects, if found return true, else false. Also define another method to get the name of employee having highest salary in a set of employees. String getHighestSalary(Employee e[ ]) To return the name of the employee with highest salary in an array of employee objects. Input: At least 3 employee details like name, empid, salary and age. Name of employee to search Id of employee to search Output: true/false if the employee found with name true/false if the employee found with id Name of employee with highest salary
Write a java program to create a class Employee which contains member variables as
name (String object)
empid (Integer object)
salary (Float object)
age (Integer object)
Define a default as well as a parameterized constructor to initialize member variables with default and specified values respectively.
Define and overload a method search as defined below
boolean search (Employee e[ ], String name)
To search an employee with name in an array of employee objects, if found return true, else false.
boolean search (Employee e[ ], Integer empid)
To search an employee with the empid in an array of employee objects, if found return true, else false.
Also define another method to get the name of employee having highest salary in a set of employees.
String getHighestSalary(Employee e[ ])
To return the name of the employee with highest salary in an array of employee objects.
Input:
At least 3 employee details like name, empid, salary and age.
Name of employee to search
Id of employee to search
Output:
true/false if the employee found with name
true/false if the employee found with id
Name of employee with highest salary

Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









