Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 3 : [ 5 0 Marks ] 3 . You are tasked with developing a Java application to manage employee information, including their ID
QUESTION : Marks
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.
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. marks
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 nonempty string and not contain any numeric characters or special characters. Handle invalid job roles using custom exception handling. marks
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 nonempty string and not contain any numeric characters or special characters. Handle invalid departments using custom exception handling. marks
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. marks
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. marks
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. marks
Draw a UML class diagram for the classes Employee, JobRole, Department, EmployeeInfo, and EmployeeManagement, including the fields, constructors, methods, and the relationship between classes. marks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started