Hello people,
Choose from the two versions of this post:
[THE LENGTHY INTRODUCTION]
So, I'm making some functions, I think I'm real slick, when all of a sudden...WHAM! Right in the face...a question begins to form, making my skin start to crawl, and without me even realizing it, I'm scratching my head...ok enough of the lengthy introduction. So...
[RIGHT TO THE POINT]
I'm writing a program and making some calculation modules. Now the main data is the current salary employee's are getting paid, and then their current salary with an 8% increase tacked on.
Also, the total payroll pre-increase, and the total payroll post-increase.
The functions I have are Calculate_pay_increase: which simply receives a salary and does the math to return the increased salary
The other function is calculate_total_payrolls: which would calculate the pre and post payrolls. However, am I adding more math than necessary when I do this? Should I, instead, calculate the total post-increase payroll within the Calculate_pay_increase function? Or is that making the function do too much? Or should I be willing to do extra calculations for the sake of the modules?