dimanche 20 décembre 2020

Selecting an option from a huge choices of possibilities

Currently, I am trying to write a backend program to find out the Employer Contribution amount based on salary of the employee. However, the amount is not calculated by percentage but it's a fixed amount and there are at least a thousand of possibilities. For example,

wages > $800 and wages < $900
   contribution amount is $1.70
wages > $900 and wages < $1000
   contribution amount is $1.90
wages > $1000 and wages < $1100
   contribution amount is $2.00

Since the amount is not based on formula, I thought the solution is to use a lot of conditions but with this much possibilities I'm afraid the server will be having a huge load and lag. Are there any advise for this problem ?

Aucun commentaire:

Enregistrer un commentaire