Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function calculateTotalCosts(salary, numWorkers, city) {
- var total = 5000+salary*numWorkers;
- switch(city) {
- case "NYC":
- total += 30000;
- break;
- case "BEJ":
- total += 25000;
- break;
- default:
- total += 10000;
- }
- return total;
- }
- console.log(alculateTotalCosts(40000, 3, "DLH"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement