Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab #3 (Sales Tracker) - 125 Points In our third lab of the semester we will create a Java CLI application that enables a manager

Lab #3 (Sales Tracker) - 125 Points

In our third lab of the semester we will create a Java CLI application that enables a manager to enter up to 20 salespeoples names, IDs and annual sales. Each salesperson must be anobject 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.

Lab Parameters

We need to use two separate exercises for our lab. To create the object class use the first half of Exercise 6A on pages 433-434 of the textbook. Make sure to add the salespersons name. You only need the information on constructing the Salesperson class not the DemoSalesperson application in this exercise.

After creating the Salesperson class, use Exercise 5 on page 485 of the textbook to create your application class. All parameters and logic in this section should be included, except for deleting the record. Make sure to allow for input of the salespersons name as well.

Please note the following important distinctions:

There is no actual database for this lab even though the exercises says to pretend its a database. We are working with arrays and no data will be stored between application runs.

CreateSalesperson.java:

This is the name of your main application class. The logic noted in Exercise 5 (Chapter 9) should be included here except there are no deletions.

Remember that the application class controls the programs logic.

Salseperson.java:

Your class used to create each of the 20 potential salesperson objects. Each contains a name, ID, and annual sales. This is from Exercise 6A (Chapter 8).

Make sure to add ASCII design and include your companys name and other important information in the output.

Lab Parameter Reminders:

ID must be eight characters and not a duplicate.

No parallel arrays.

Each salesperson must be an object.

Only 20 entries permitted.

If user select "add" option:

Issue an error message if the database (array) is full

Otherwise, prompt the user for an ID number

If 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 user select "change" option:

Issue an error message if the database (array) is empty

Otherwise, prompt the user for an ID number

If 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

Do not delete the record.

Make sure to check the documentation guide and follow the directions for the header block and inline documentation.

output like

image text in transcribedimage text in transcribed

Output - Lab3Demo (run) run: What would you like to do today? (A)dd a Record (C)hange a Record (Q)uit Please enter in your choice: add Invalid input What would you like to do today? (A)dd a Record (C)hange a Record (Q)uit Please enter in your choice: ghf Invalid input What would you like to do today? (A)dd a Record (C)hange a Record (Q)uit Please enter in your choice: A Please enter your ID: 65678 Please enter eight digits for your ID: 12345678 Please enter your name: Bubba Please enter your sales amount: $23457 Do you want to display your database? Y/N: N What would you like to do today? (A)dd a Record (C)hange a Record Please enter in your choice: A Please enter your ID: 12345678 Identification number already exists, try again. Enter identification number: 12345677 Please enter your name: John Please enter your sales amount: $55555 Do you want to display your database? Y/N: Output - Lab3Demo (run) run: What would you like to do today? (A)dd a Record (C)hange a Record (Q)uit Please enter in your choice: add Invalid input What would you like to do today? (A)dd a Record (C)hange a Record (Q)uit Please enter in your choice: ghf Invalid input What would you like to do today? (A)dd a Record (C)hange a Record (Q)uit Please enter in your choice: A Please enter your ID: 65678 Please enter eight digits for your ID: 12345678 Please enter your name: Bubba Please enter your sales amount: $23457 Do you want to display your database? Y/N: N What would you like to do today? (A)dd a Record (C)hange a Record Please enter in your choice: A Please enter your ID: 12345678 Identification number already exists, try again. Enter identification number: 12345677 Please enter your name: John Please enter your sales amount: $55555 Do you want to display your database? Y/N

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

Describe Balor method and give the chemical reaction.

Answered: 1 week ago

Question

How to prepare washing soda from common salt?

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago