(Please use JAVA) Create custom exception and implement exception handling Create the following classes based on the UML Class diagram: - Employee - InvalidUserDetailException - EmployeeValidation-uses the custom InvalidUserDetailException class. This class contains an instancemethod validateInput() which will validate the employee details (name, age & gender) based on the specified criteria. * If employee details are within the criteria, employee details will be outputted in the console. * If employee details are not within the criteria, InvalidUserDetailException will be thrown with a message informing user that employee detail inputted is invalid. Create Employee Main class which will contain the main() method main() method will allow user to input employee name, age and gender. Calls validateInput() to validate the employee details.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
(Please use JAVA) Create custom exception and implement exception handling Create the following classes based on the UML Class diagram: - Employee - InvalidUserDetailException - EmployeeValidation-uses the custom InvalidUserDetailException class. This class contains an instancemethod validateInput() which will validate the employee details (name, age & gender) based on the specified criteria. * If employee details are within the criteria, employee details will be outputted in the console. * If employee details are not within the criteria, InvalidUserDetailException will be thrown with a message informing user that employee detail inputted is invalid. Create Employee Main class which will contain the main() method main() method will allow user to input employee name, age and gender. Calls validateInput() to validate the employee details.
8
-name: String
age: int
gender: String
Employee
+ getName(): String
+ setName(name: String): void
+getAge(): int
+ setAge(age: int): void
+getGender(): String
+ setGender(gender: String): void
EmployeeValidation
+ validatelnput(emp: Employee): void
validatelnput(Emloyee) validates the employee details
based on the following criteria:
1) Name must not be less than 3 characters
2) Age must be between 18-65 years old
3) Gender must either be female or male (non-case
sensitive)
8
<<throws>>>
Exception
4
Extends
InvalidUserDetailException
--------▷-<<initialize>> serialVersionUID: long = 1L
+ InvalidUserDetailException(message: String)
Transcribed Image Text:8 -name: String age: int gender: String Employee + getName(): String + setName(name: String): void +getAge(): int + setAge(age: int): void +getGender(): String + setGender(gender: String): void EmployeeValidation + validatelnput(emp: Employee): void validatelnput(Emloyee) validates the employee details based on the following criteria: 1) Name must not be less than 3 characters 2) Age must be between 18-65 years old 3) Gender must either be female or male (non-case sensitive) 8 <<throws>>> Exception 4 Extends InvalidUserDetailException --------▷-<<initialize>> serialVersionUID: long = 1L + InvalidUserDetailException(message: String)
Sample Output: Invalid employee name.
*** Input Employee Details ***
Name: A
Age: 21
Gender: Female
Invalid Employee name A. Must be at least 3 characters.
Sample Output: Invalid employee age.
*** Input Employee Details ***
Name: John Doe
Age: 16
Gender: Male
Invalid Employee age. Must be between 18 - 65 years old.
Sample Output: Invalid employee gender.
*** Input Employee Details ***
Name: Jane Doe
Age: 24
Gender: femme
Invalid Employee gender. Only accepts either male or female.
Sample Output: Valid employee details.
*** Input Employee Details ***
Name: John Doe
Age: 21
Gender: Male
*** Employee Details ***
Name John Doe, Age=21, Gender-Male
Transcribed Image Text:Sample Output: Invalid employee name. *** Input Employee Details *** Name: A Age: 21 Gender: Female Invalid Employee name A. Must be at least 3 characters. Sample Output: Invalid employee age. *** Input Employee Details *** Name: John Doe Age: 16 Gender: Male Invalid Employee age. Must be between 18 - 65 years old. Sample Output: Invalid employee gender. *** Input Employee Details *** Name: Jane Doe Age: 24 Gender: femme Invalid Employee gender. Only accepts either male or female. Sample Output: Valid employee details. *** Input Employee Details *** Name: John Doe Age: 21 Gender: Male *** Employee Details *** Name John Doe, Age=21, Gender-Male
Expert Solution
steps

Step by step

Solved in 5 steps with 5 images

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education