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 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. Sample output for Part e Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> A Enter Employee ID >> 500 Get user input here……………………………… Current database: ID 500 SSN: 999-23-1234 first name: Mehwish last name: B. address: Burnaby dept: HR annual salary: 89000.0 Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> A Enter Employee ID >> 600 Get user input here……………………………… 3 Current database: ID 500 SSN: 999-23-1234 first name: Mehwish last name: B. address: Burnaby dept: HR annual salary: 89000.0 ID 600 SSN: 123-12-1234 first name: Sarah last name: T address: Vancouver dept: MARKTING annual salary: 45678.0 Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> D Enter ID to delete >> 500 Current database: ID 600 SSN: 123-12-1234 first name: Sarah last name: T address: Vancouver dept: MARKTING annual salary: 45678.0 Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> C Enter ID to change >> 34 Sorry - ID number #34 does not exist in the database Current database: ID 600 SSN: 123-12-1234 first name: Sarah last name: T address: Vancouver dept: MARKTING annual salary: 45678.0 4 Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> C Enter ID to change >> 600 Enter salary >> 56000 Current database: ID 600 SSN: 123-12-1234 first name: Sarah last name: T address: Vancouver dept: MARKTING annual salary: 56000.0 Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> Q Good bye!!
Create another application/class named EmployeeDatabase that allows you to store an
array that acts as a
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 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.
Sample output for Part e
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> A
Enter Employee ID >> 500
Get user input here………………………………
Current database:
ID 500
SSN: 999-23-1234
first name: Mehwish
last name: B.
address: Burnaby
dept: HR
annual salary: 89000.0
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> A
Enter Employee ID >> 600
Get user input here………………………………
3
Current database:
ID 500
SSN: 999-23-1234
first name: Mehwish
last name: B.
address: Burnaby
dept: HR
annual salary: 89000.0
ID 600
SSN: 123-12-1234
first name: Sarah
last name: T
address: Vancouver
dept: MARKTING
annual salary: 45678.0
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> D
Enter ID to delete >> 500
Current database:
ID 600
SSN: 123-12-1234
first name: Sarah
last name: T
address: Vancouver
dept: MARKTING
annual salary: 45678.0
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> C
Enter ID to change >> 34
Sorry - ID number #34 does not exist in the database
Current database:
ID 600
SSN: 123-12-1234
first name: Sarah
last name: T
address: Vancouver
dept: MARKTING
annual salary: 45678.0
4
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> C
Enter ID to change >> 600
Enter salary >> 56000
Current database:
ID 600
SSN: 123-12-1234
first name: Sarah
last name: T
address: Vancouver
dept: MARKTING
annual salary: 56000.0
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> Q
Good bye!!
Step by step
Solved in 2 steps