Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Change Java application below using NetBeans IDE to meet these additional and changed business requirements:

Change Java application below using NetBeans IDE to meet these additional and changed business requirements:

  • The application will now compare the total annual compensation of at least two salespersons.
  • It will calculate the additional amount of sales that each salesperson must achieve to match or exceed the higher of the two earners.
  • The application should ask for the name of each salesperson being compared.

The Java application should also meet these technical requirements:

  • The application should have at least one class, in addition to the application's controlling class.
  • The source code must demonstrate the use of Array or ArrayList.
  • There should be proper documentation in the source code.

______________________________________________________________________________________________________________________________

import java.util.Scanner;

/**

 *

 * @author Deneshia Lamar

 */

public class CommissionCalculatorApp {

  /**

   * @param args the command line arguments

   */

  public static void main(String[] args) {

      try (Scanner input = new Scanner(System.in)) {

          System.out.println("Please enter Annual Sales:");

          double annualSales = input.nextDouble();

          double TotalCompensation; //Total annual compensation

          double AnnualSales = 0;

          double half = annualSales * .50;// 50% of salesperson total annual sales

          double initAmount = annualSales;

          System.out.printf("n%15s %15sn", "Total Sales", "Total Compensation");

          for (double i = initAmount; i <= (initAmount + half); i += 5000.0) {

              TotalCompensation = AnnualSales;

              System.out.printf("$%15.2f $%15.2fn", i, TotalCompensation);

          }

      }

  }  

}

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

/*

A Sales person will earn a fixed salary of $12,000 every year.

The target sale for each sales person is $120,000.

The sale incentive will start only when the sales met 80% of the sales target.

The current sales commision is 7% in each sale. If a sales person exceedes the

target sale their commision will increase by 1.25%.

 */

/**

 *

 * @author Deneshia Lamar

 */

public class Salesperson{

  private final int fixed = 12000;// Fixed annual sales.

  private final double target = 120000; //Sales person extimated target sales.

  private final double acceleration = 1.25;// If salesperson exceeds the target sales, the commission will increase based on an acceleration factor.

  private final double commissionRate = 0.07; //Current commission of total sales.

  public double getCommission(double totalSale) {

      double commissionEarned = 0.0;

      if (totalSale >= target) {

          commissionEarned = totalSale * acceleration * commissionRate;

      } else if (totalSale >= (0.80 * target) && (totalSale < target)) {

          commissionEarned = totalSale * commissionRate;

      }

      return commissionEarned;

  }

  public double TotalCompensation(double totalSale) {

      double totalCompensation = fixed + getCommission(totalSale);

      return totalCompensation;

  }

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question