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: | 337 Weeks 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