public class Wk4SalespersonCommissionModified
{
//fixed salary
private final int salary = 30000;
//sales
private double sales;
private String name; //added from other student's code
//constructor
public
Wk4SalespersonCommissionModified(double sales) {
this.sales = sales;
}
//get annual compensation
public double annualCompensation() {
return salary + commissionOnSales();
}
//methods to get salary and sales amount
public int getSalary() {
return salary;
}
public double getSales() {
return sales;
}
public double commissionOnSales() {
double incentive=0;
final double targetSales=120000;
if(sales>=targetSales)
{
incentive=sales*.05;
incentive …show more content…
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.
*/
/*****************************Changed per merging with othr student's
********************/
Scanner input = new Scanner(System.in);
SalespersonCommissionModified sc1
= new SalespersonCommissionModified();
sc1.promptForName();
String name1 = …show more content…
ArrayList al1 = new ArrayList();
al1.add("\nSalesperson: "+name1);
al1.add("Total Sales Total Compensation");
// do
int count=0;
for(int i=(int)sales1;icompensation2)
{
System.out.println("Salesperson "+name2+"'s additional amount of sales that he must