Home /
Expert Answers /
Computer Science /
write-a-complete-java-program-that-manages-a-group-of-employees-create-a-class-called-employee-pa405
(Solved):
Write a complete Java program that manages a group of employees: - Create a class called Employee. ...
Write a complete Java program that manages a group of employees: - Create a class called Employee. The attributes of this class should be as follows: Employee number (id) : String Employee name (name): String Number of work hours (hours): double Hourly rate (rate): double Address (address): String - the address should be stored based on the following format Building_name#tstreet_nameffcity#BO_Box. Note that all information is stored as one string and separated using #. - Provide appropriate constructors, setters, and getters methods. - Create a method named getCity0 that extracts city name Create method getSalary() that calculates salary (salary = hours * rate) Create method changeCity(cityName) that changes city name. - First your application should accept employee information from keyboard. The user will enter let's say 5 employees from keyboard. For the address, the same address format will be used when entering from keyboard, so the user will enter the whole address in one string separated by #\#. Example: Enter address: AlShoroq Building#Main Street#Ramallah #9843 - You should store all employees in an array. - The program should display the following menu options: - 1- Find number of employees living in city? - Here, if the user selects this option, you will ask him to enter city name and you will display the number of employees living in that city. - 2-Calculate average salaries - Here you will display the average salary for all employees - 3- Change city for an employee - Here you allow the user to enter employee number, and new city name, then you change the city name for that employee. - 4isplay the information of the employee who has the largest salary - If user selects this option, you will display the full information of employee that has largest salary. 1
5- Exit - End the program Enter your choice...(1-5)? - Your program will keep working until the user select \( 5 \rightarrow \) Exit. - In summary. your program will first allow the user to enter information for five employees, then it will display the menu of options and keep running until the user selects 5 to exit. Please note the Followings: 1. Your program should be well commented based on Java formal documentation.