+ 2
Struggling to create efficient source codes c# ?
Salary can be around 16000, however they want you to calculate and create a source code for housing allowance and it's 10% of the salary and transport allowance which is 5% of the salary and there you have a gross salary which is the sum of the salary and all the other allowance. tax is 15% of the gross salary ,while net salary will be the gross salary less the tax ,how would this system follow up?
1 ответ
+ 1
For simple requirements like this, you can be safe and perform each operation on a separate variable: it would be less error-prone and clearer to understand. IMHO don't worry too much about performance in this case, as the computations are not that complicated.