Posted By

Scooter on 09/11/10


Tagged


Versions (?)

Calculate monthly and/or annual salary


 / Published in: ASP
 

URL: http://reusablecode.blogspot.com/2010/09/calculating-annual-salary-for-employees.html

Requires my WorkingDays function.

  1. <%
  2. ' Copyright (c) 2010, reusablecode.blogspot.com; some rights reserved.
  3. '
  4. ' This work is licensed under the Creative Commons Attribution License. To view
  5. ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
  6. ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
  7. ' 94305, USA.
  8.  
  9. function annualSalary(someYear, hourlyPay)
  10. const hoursPerDay = 8
  11. annualSalary = 0
  12.  
  13. for i = 1 to 12
  14. annualSalary = annualSalary + WorkingDays(someYear, i) * hoursPerDay * hourlyPay
  15. next
  16. end function
  17.  
  18. function monthlySalary(someYear, someMonth, hourlyPay)
  19. const hoursPerDay = 8
  20. monthlySalary = 0
  21.  
  22. monthlySalary = monthlySalary + WorkingDays(someYear, someMonth) * hoursPerDay * hourlyPay
  23. end function
  24. %>

Report this snippet  

You need to login to post a comment.