Salary

in #ita21 days ago

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;     

    

      

} 

}

Sort:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(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.

Coin Marketplace

STEEM 0.27
TRX 0.11
JST 0.030
BTC 67688.54
ETH 3821.02
USDT 1.00
SBD 3.55