Struggling to create efficient source codes c# ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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?

21st Apr 2017, 9:43 PM
Innocentia mia
Innocentia mia - avatar
1 Answer
+ 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.
25th Apr 2017, 6:04 AM
Álvaro