Question: This program needs to be coded in Java. There is two required classes: CreateSalesperson Salesperson I need to create a program that enables a manager

This program needs to be coded in Java.

There is two required classes:

CreateSalesperson

Salesperson

I need to create a program that enables a manager to enter up to 20 salespeoples names, IDs and annual sales. Each salesperson must be an object and must be part of one array. (No parallel arrays permitted.)

The manager can choose to add a new salesperson until there are 20 total. Once 20 salespeople are present, no new data can be added. (No duplicate IDs should be entered.)

Once the manager is finished, display all the salesperson data in an easy to read format. In addition, the manager can change a salespersons annual sales by entering a salespersons ID. Make sure to check if that salesperson exists and inform the manager.

After the change, re-display the list. Please note: IDs are eight digits long and cannot be duplicated.

Now, create an application that allows you to store an array that acts as a database of any number of Salesperson objects up to 20. 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 number. If the ID number already exists in the database, issue an error message. Otherwise, prompt the user for a sales value 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 number. If the ID number does not exist, issue an error message. Otherwise, do not access the record for any future processing.

If the user selects the change option, issue an error message if the database is empty. Otherwise, prompt the user for an ID number. If the requested record does not exist, issue an error message. Otherwise, prompt the user for a new sales value and change the sales value for the record.

After each option executes, display the updated database in ascending order by Salesperson ID number and prompt the user to select the next action.

Thank you for your help!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!