The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 1 Day Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
I need to change the code below to meet these requirements.
The Java application should also meet these technical requirements:
Here is the code I have
Â
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package salarycompensation;
Â
import java.util.Scanner;
Â
Â
public class salarycompensationImpl extends salarycompensation {
  public static void main(String[]args){
  Scanner user_input = new Scanner (System.in);
  Â
  System.out.println("Welcome to the Compensation Calculator");
  double salary = 35750;
    //this is the base salary
  System.out.println("Your annual salary is" + salary);
  double commRate = .12;
    // this is the commission rate
   double yrlySales;
    //this is the total yearly sales
   System.out.println("Please enter your yearly sales total");
    Scanner sc = new Scanner(System.in);
    Â
import java.util.Scanner;
Â
public class SalesDriver {
Â
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    SalesPerson salesPerson = new SalesPerson();
Â
    System.out.print("Enter your current annual sales: $");
    double sales = input.nextDouble();
Â
    salesPerson.setAnnualSales(sales);
    System.out.println("Current salary: $" + salesPerson.getSalary());
Â
    System.out.println("Estimated amount from commission: $" + salesPerson.getCommissionAmount());
Â
    System.out.println("Total compensation is expected to be: $" + salesPerson.getCompensation());
    //potential sales
    System.out.println("Total SalestTotal compensation: ");
    double target = 1.5 * sales;
    Â
    for (double x = sales; x <= target; x += 5000) {
      salesPerson.setAnnualSales(x);
      System.out.println(x + "t" + salesPerson.getCompensation());
    }
Â
  }
}
Â
Â
Â
public class SalesPerson {
Â
  Â
  double fixedSalary = 35750.00;
  double incentive = 80;
  double salesTarget = 125250;
  double accelerationFactor = 1.75;
  double percentageCommission = 12;
  double totalCommision = 0;
  double sales = 0;
Â
  public void setAnnualSales(double sales) {
    this.sales = sales;
  }
Â
  public double getSalary() {
    return this.fixedSalary;
  }
Â
  public double getCommissionAmount() {
Â
    if (sales >= salesTarget) {
      totalCommision = (sales * (percentageCommission / 100 * accelerationFactor));
Â
    }
Â
    if (sales <= salesTarget && sales >= (incentive / 100 * salesTarget)) {
      totalCommision = (percentageCommission * sales / 100);
    }
    return totalCommision;
Â
  }
Â
  public double getCompensation() {
Â
    return getCommissionAmount() + fixedSalary;
  }
Â
}
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly