) Create an enumeration named Departments that contain four sets of values FINANCE, HR, IT, and MARKETING. b) Create a class named PersonDetails that contains fields for a person’s first name (String), last name (String), and address (String). The class have A constructor that accepts parameters for each field and Get methods for each field. c) Create a class named Employee that contains fields for an employee ID (int), Social Security number (String), personal information (Person object), department (Departments type), and annual salary (double). The class have A constructor that requires values for each data field. Get methods for each of the data fields. Set methods for each of the data fields. d) Create an application/class named EmployeeSort that allows a user to enter values for an array of 5 Employee objects (create an array of Employee type that will save 5 employee objects). Prompt a user for the data needed to create an employee object. Continue to 2 prompt the user for Social Security number, if it is not incorrect format with digits and dashes in the appropriate positions e.g. 999-99-9999. Offer users the choice of displaying the objects in order by either Id or salary. e) Create another application/class named EmployeeDatabase that allows you to store an array that acts as a database of any number of Employee objects up to 25. While the user decides to continue, offer three options: to add a record to the database, to delete a record from the database, or to change a record in the database. Then proceed as follows:  If the user selects the add option, issue an error message if the database is full. Otherwise, prompt the user for an Id. If the Id already exists in the database, issue an error message. Otherwise, prompt the user for the rest of the inputs and add the new record to the database.  If the user selects the delete option, issue an error message if the database is empty. Otherwise, prompt the user for an Id. If the Id does not exist, issue an error message. Otherwise, delete the record.  If the user selects the change option, issue an error message if the database is empty. Otherwise, prompt the user for an Id. If the requested record does not exist, issue an error message. Otherwise, prompt the user for a new salary value and change the salary value for the record.  After each option executes, display the updated database in ascending order by Employee Id and prompt the user to select the next action. Part e should be done using an array but not ArrayList.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question

a) Create an enumeration named Departments that contain four sets of values FINANCE, HR, IT, and MARKETING.
b) Create a class named PersonDetails that contains fields for a person’s first name (String), last name (String), and address (String). The class have
A constructor that accepts parameters for each field and Get methods for each field.
c) Create a class named Employee that contains fields for an employee ID (int), Social Security number (String), personal information (Person object), department (Departments type), and annual salary (double). The class have
A constructor that requires values for each data field.
Get methods for each of the data fields.
Set methods for each of the data fields.
d) Create an application/class named EmployeeSort that allows a user to enter values for an array of 5 Employee objects (create an array of Employee type that will save 5 employee objects). Prompt a user for the data needed to create an employee object. Continue to 2
prompt the user for Social Security number, if it is not incorrect format with digits and
dashes in the appropriate positions e.g. 999-99-9999.
Offer users the choice of displaying the objects in order by either Id or salary.
e) Create another application/class named EmployeeDatabase that allows you to store an array that acts as a database of any number of Employee objects up to 25. While the user decides to continue, offer three options: to add a record to the database, to delete a record from the database, or to change a record in the database. Then proceed as follows:
 If the user selects the add option, issue an error message if the database is full.
Otherwise, prompt the user for an Id. If the Id already exists in the database, issue an error message. Otherwise, prompt the user for the rest of the inputs and add the new record to the database.
 If the user selects the delete option, issue an error message if the database is empty.
Otherwise, prompt the user for an Id. If the Id does not exist, issue an error message.
Otherwise, delete the record.
 If the user selects the change option, issue an error message if the database is empty.
Otherwise, prompt the user for an Id. If the requested record does not exist, issue an error message. Otherwise, prompt the user for a new salary value and change the salary value for the record.
 After each option executes, display the updated database in ascending order by Employee Id and prompt the user to select the next action.
Part e should be done using an array but not ArrayList.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
JQuery and Javascript
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,