generate functionSun, 22 Jan 2023

i want to store information about the employees of a company. For each employee i want to store the following information: The employee number, name, year of incorporation in the company, name of the department to which he/she belongs, salary and occupation. The company has only 3 departments: Sales, Marketing and Development. When the user is asked for the data, the user will enter 10, 20 or 30 respectively and the department will be assigned to the department will be assigned to the object using an enum type. From Likewise, the available positions are: PROGRAMMER, ANALYST and PROJECT MANAGER. Without However, when entering the data, the user will enter 1, 2 or 3, respectively, and the trade will be assigned to the the Employee object using an enum type. The constructor of the class will be all the data except the employee number, which will be a generated number (the first employee to be employee number 1, the second employee number 2 and so on). and so on). The employee will have a toString method and an equals method.

package; import javax.swing.*; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(; Employee employee = new Employee(); Department department = new Department(); Position position = new Position(); for (int i = 0; i < 5; i++) { System.out.print("Name: "); String name = input.nextLine(); System.out.print("Year of incorporation: "); int incorporation = input.nextInt(); System.out.print("Department: "); int dep = input.nextInt(); department.setDepartment(dep); System.out.print("Salary: "); int salary = input.nextInt(); System.out.print("Position: "); int pos = input.nextInt(); position.setPosition(pos); System.out.println(); employee.setEmployee(name, incorporation, department

Questions about programming?Chat with your personal AI assistant