Answered step by step
Verified Expert Solution
Link Copied!

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 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]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions

Question

What is meant by formal organisation ?

Answered: 1 week ago

Question

What is meant by staff authority ?

Answered: 1 week ago

Question

Discuss the various types of policies ?

Answered: 1 week ago

Question

Briefly explain the various types of leadership ?

Answered: 1 week ago

Question

Explain the need for and importance of co-ordination?

Answered: 1 week ago