Question: QUESTION 3 : [ 5 0 Marks ] 3 . You are tasked with developing a Java application to manage employee information, including their ID

QUESTION 3: [50 Marks]
3. You are tasked with developing a Java application to manage employee information, including their ID number, job role, and department. You need to implement the necessary classes with custom exception handling, usage of Scanner (
System.in) for user input, logging using java.util.logging, and demonstrate the concepts of inheritance, method overriding or polymorphism.
3.1. Create an abstract public class named Employee with fields for the employee's name and age. Include a constructor and appropriate getter and setter methods for the fields. Implement a public displayInfo() method that displays the employee's name and age. [7 marks]
3.2. Create a class named JobRole that includes fields to hold the job role of the employee. Implement a default constructor that sets the field to "Unassigned" and an overloaded constructor that requires a value for the field. Include appropriate getter and setter methods for the job role. A role name should be a non-empty string and not contain any numeric characters or special characters. Handle invalid job roles using custom exception handling. marks]
3.3. Create a class named Department that includes fields to hold the department of the employee. Implement a default constructor that sets the field to "General" and an overloaded constructor that requires a value for the field. Include appropriate getter and setter methods for the department. A department name should be a non-empty string and not contain any numeric characters or special characters. Handle invalid departments using custom exception handling. [6 marks]
3.4. Create a class named EmployeeInfo that extends the Employee class and includes a field for the employee's ID number, a JobRole object, and a Department object. Implement a constructor that takes values for all fields, including the inherited fields. Override the displayInfo() method to display the employee's name, age, job role, and department. [10 marks]
3.5. Create EmployeeManagement class. In the main method of the class, create an instance of the EmployeeInfo class using user input for the name, age, ID number, job role, and department. Use Scanner(
System.in) to obtain the user input. Handle any invalid inputs with appropriate exception handling and display an error message. [8 marks]
3.6. Implement logging using java.util.logging in the EmployeeManagement class. Log the employee's information (name, age, ID number, job role, and department) after successful creation. In case of an exception, log the error message with the appropriate level. [6 marks]
3.7. Draw a UML class diagram for the classes Employee, JobRole, Department, EmployeeInfo, and EmployeeManagement, including the fields, constructors, methods, and the relationship between classes. [7 marks]
 QUESTION 3: [50 Marks] 3. You are tasked with developing a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!