Advertisement
achshar

Untitled

May 9th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function calculateTotalCosts(salary, numWorkers, city) {
  2.     var total = 5000+salary*numWorkers;
  3.     switch(city) {
  4.         case "NYC":
  5.             total += 30000;
  6.         break;
  7.         case "BEJ":
  8.             total += 25000;
  9.         break;
  10.         default:
  11.             total += 10000;
  12.     }
  13.     return total;
  14. }
  15. console.log(alculateTotalCosts(40000, 3, "DLH"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement