Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a java program that produces the following output. The objectives of this assignment are to: 1. Review and gain further experience in the use
Write a java program that produces the following output.
The objectives of this assignment are to: 1. Review and gain further experience in the use of the Eclipse IDE for Java. 2. Review and gain further experience in Java programming. 3. Review and gain further experience in the use of Java sentinel-controlled loops. 4. Gain an understanding and experience in passing arrays to methods. 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 commission. Save the file as Prog1.java. Method double commission( double sales ) double total( double[] arr, int num) Description returns commission as 7.5% of sales returns total of values in array arr that contains num values Sample output for Pete Zah Sales for Pete Zah Sales 1,200.00 564.73 1,050.50 200.00 Commission 90.00 42.35 78.79 15.00 Total Sales: 3,015.23Step 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