Question: Write a Java program that reads sales data from the user and displays the sales and commission, along with total commission. The program will begin

Write a Java program that reads sales data from the user and displays the sales and commission, along with total commission. The program will begin by asking the user to enter the name of the salesperson. (Note: the name may contain spaces and periods)

Create an array of ten doubles for sales. Read in sales values from the user and store them in the array until a negative sales number is entered or ten values have been entered. Use appropriate prompts to request user input. When done reading sales, print a report in the exact format shown below. While printing, use the following static methods to determine commission and total sales. Save the file as Prog1.java.

Method

Description

double commission( double sales )

returns commission as 7.5% of sales

double total( double[] arr,

int num )

returns total of values in array arrthat contains num values

Sample output for Pete Zah

Sales for Pete Zah

Sales Commission

1,200.00 90.00

564.73 42.35

1,050.50 78.79

200.00 15.00

Total Sales: 3,015.23

Source Code Documentation

All source code files should contain block of comments with the format shown below at the beginning of the file.

/**

* COSC 210-001 Assignment 1

* FileName.java

*

* Provide a short description of what the program does so that the

* reader knows the purpose of the class.

*

* @

*/

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!