Question: You are asked to develop a compensation calculator application for a department store. At the department store, the compensation of sales staff consists of a
You are asked to develop a compensation calculator application for a department store. At the department store, the compensation of sales staff consists of a base salary and a commission. The base salary is $5,000, and the commission rate is tiered based on sales amount as following: Sales Amount Commission Rate $0.01 $5,000 8% $5,000.01 $10,000 10% $10,000.01 and above 12% For example, if the sales amount is $12,000, the commission rate is calculated as following: commission = $5,000 * 8% + ($10,000 - $5,000) * 10% + ($12,000 - $10,000) * 12%. Requirements: (1) Define a method that computes the commission, using the above commission scheme. The header of this method should be like this: public static double computeCommission(double salesAmount) Note: This method and the ones defined in (2) and (3) need to be in your main class but outside the main method. (2) Define a printCommission method, which receives three parameters representing the beginning sales amount, sales increment, and ending sales amounts, and has no return. This method uses a for-loop to display a sales and commission table. For example, if the beginning sales amount is 10000, sales increment is 5000, and the ending sales amount is 100000, then this method will print out the following table: Sales Amount Commission Rate 10000 900.0 15000 1500.0 95000 11100.0 100000 11700.0 Note: this method must call the computeCommission method to determine the commission rate column. (3) Next, define a targetSales method, which receives one parameter representing a desired salary and returns the corresponding sales amount that generates the desired salary. For example, if a staffs desired salary is 30000 (which consists of base salary + commission), this method will return a sales amount of 210833.34, which is the minimum sales amount that the staff must generate to earn the desired 30000 salaries. Note: this method must use a while loop or do-while loop, and it must call the computeCommission method inside the loop. In addition, it starts with an initial sales amount of 1 cent and increases the sales amount by 1 cent only in each iteration until it finds the sales amount needed to generate the desired salary. (4) In the main method, call the printCommission method to display a sales-commission table with 10000 as the beginning sales amount, 5000 as the sales increment, and 100000 as the ending sales amount. Then, ask users to enter their desired salary and use it as the parameter to call the targetSales method. Lastly, display a message informing users the sales amount needed for the desired salary.
This is being done in Java (NetBeans) I have so many errors in the partial code I have written... I'm so stuck... please help...
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
