Question: Write a java program with comments using the following instructions: A company has sales reps that sell two different product lines. The sales amounts for

Write a java program with comments using the following instructions:

A company has sales reps that sell two different product lines. The sales amounts for each product are recorded, and commission is calculated based on the total sales. Commission is:

-5% of sales for sales < 4000

-7% of sales for 4000 to < 8000

-10% of sales for 8000 or above

Create a class called SalesRep with attributes (private data members) of:

-Salesrep name

-Product1 sales amount

-Product2 sales amount

Include these methods (note that you may or may not use all of them in your app)

-Create a default and parameterized constructor

-Create set / get methods for name

-Create get methods to calculate and return total sales, commission

Create your app class, SalesRepTest. In main, you will create an arrayList (or static array, your choice) of these SalesRep objects. (If you use a static array, make it large enough to hold 20 salesreps, but there may be less than 20 entered). Implement the following menu options:

1 Add sales rep prompt for name and the two sales amounts, add to arrayList or array

2 - Print sales report prints the name, total sales, and commission for all reps entered into the system in the format shown below on sample output. Also calculate and print the total sales and commission of all reps (note totals calculated in app, not in class).

3 - Print Diamond Club Prints the name and total sales of all reps with $10000 or more in total sales

4 - Exit

You should validate the menu choice with a loop. You can assume all sales rep data is valid

SAMPLE OUTPUT: (must caculate total sales and commision on our own which is why answer is not given)

Sales Reporting System 1  Add rep 2 - Print sales report 3 - Print Diamond Club 4 - Exit Enter your choice: 5 Invalid choice, re-enter: 1 Enter name: Captain Kirk Enter product 1 sales: 8500 Enter product 2 sales: 2650 (show menu) Enter your choice: 1 Enter name: Bruce Wayne Enter product 1 sales: 4880 Enter product 2 sales: 3120 (show menu) Enter your choice: 2 Sales Report Salesperson Total Sales Commission Captain Kirk $ xxxxx.xx $ xxxxx.xx Bruce Wayne $ xxxxx.xx $ xxxxx.xx Total $ xxxxx.xx $ xxxxx.xx (menu) Enter your choice: 1 Enter name: Harry Potter Enter product 1 sales: 1500 Enter product 2 sales: 850 (menu) Enter your choice: 1 Enter name: Peter Parker Enter product 1 sales: 9800 Enter product 2 sales: 5100 (menu) Enter your choice: 1 Enter name: Clark Kent Enter product 1 sales: 2750 Enter product 2 sales: 1250 (menu) Enter your choice: 2 Sales Report Salesperson Total Sales Commission Captain Kirk $ xxxxx.xx $ xxxxx.xx Bruce Wayne $ xxxxx.xx $ xxxxx.xx Harry Potter $ xxxxx.xx $ xxxxx.xx Peter Parker $ xxxxx.xx $ xxxxx.xx Clark Kent $ xxxxx.xx $ xxxxx.xx Total $ xxxxx.xx $ xxxxx.xx (menu) Enter your choice: 3 Diamond Club Qualified Name Total Sales (name(s)) $ xxxxx.xx 
Sales Reporting System 1 - Print sales report 2 - Lookup sales rep 3 - Print Diamond Club 4 - Exit Enter your choice: 4 Goodbye! 

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!