Salary
public class SalaryCalculator {
public double multiplierPerDaysSkipped(int daysSkipped) {
return daysSkipped > 5 ? 1 - 0.15 : 1.0;
}
public int multiplierPerProductsSold(int productsSold) {
return productsSold > 20 ? 13 : 10;
}
public double bonusForProductSold(int productsSold) {
return multiplierPerProductsSold(productsSold)*productsSold;
}
public double finalSalary(int daysSkipped, int productsSold) {
int base = 1000;
double bonusP = bonusForProductSold(productsSold);
double tot = daysSkipped < 5 ? base + bonusP: base*multiplierPerDaysSkipped(daysSkipped) + bonusP;
return tot >= 2000.0 ? 2000.0: tot;
}
}
Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
please click it!
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)
The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.