Question
In chapter 8, you created a Salesperson class with fields for ID number and sales values. Write an application that allows you to store an
In chapter 8, you created a Salesperson class with fields for ID number and sales values. Write an application that allows you to store an array that acts a database of any numbers of salesperson objects up to 20. while the user decides to continue, offer 3 options, add a record to database, delete a record from database, or change a record in the database. Then proceeded as follows:
if the user selects the at option, issued an error message if the database is full. Otherwise, prompt the user for an ID number. If the ID number already exist in the database, issued an error message. Otherwise, prompt the user for a sales value and at the new record to the database.
If the user selects the delete option, issued an error message if the database is empty. Otherwise, prompt the user for an ID number. If the ID number does not exist, issued an error message. Otherwise, do not access the record for any future processing.
If the user selects the change option, issued an error message if the database is empty. Otherwise, prompt the user for an ID number. If the requested record does not exist, issued 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 and ascending order by salesperson ID number and prompt the user to select the next action. Save the application as SalespersonDatabase.java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started